can connect to nodejs and python

This commit is contained in:
yedongfu 2021-07-12 16:58:19 +08:00
parent f1f25125ae
commit f20372bc2b
4 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ services:
environment: environment:
IS_DOCKER_COMPOSE: '1' IS_DOCKER_COMPOSE: '1'
ports: ports:
- '80:4005' - '8080:8080'
volumes: volumes:
- .:/app/dtm - .:/app/dtm
mysql: mysql:

View File

@ -27,9 +27,9 @@ func CronTransOnce(expireIn time.Duration, status string) bool {
return true return true
} }
func CronCommitted() { func CronSubmitted() {
for { for {
notEmpty := CronTransOnce(time.Duration(0), "commitetd") notEmpty := CronTransOnce(time.Duration(0), "submitted")
if !notEmpty { if !notEmpty {
sleepCronTime() sleepCronTime()
} }

View File

@ -13,7 +13,7 @@ var dtmsvrPort = 8080
func MainStart() { func MainStart() {
StartSvr() StartSvr()
go CronCommitted() go CronSubmitted()
go CronPrepared() go CronPrepared()
} }

View File

@ -20,7 +20,7 @@ func (t *TransTccProcessor) GenBranches() []TransBranch {
} }
func (t *TransTccProcessor) ExecBranch(db *common.DB, branch *TransBranch) { func (t *TransTccProcessor) ExecBranch(db *common.DB, branch *TransBranch) {
resp, err := common.RestyClient.R().SetBody(branch.Data).SetQueryParams(t.getBranchParams(branch)).Post(branch.Url) resp, err := common.RestyClient.R().SetBody(branch.Data).SetHeader("Content-type", "application/json").SetQueryParams(t.getBranchParams(branch)).Post(branch.Url)
e2p(err) e2p(err)
body := resp.String() body := resp.String()
if strings.Contains(body, "SUCCESS") { if strings.Contains(body, "SUCCESS") {