donot wait when not test
This commit is contained in:
parent
4a7d1f0dee
commit
0c7913fef1
@ -61,9 +61,5 @@ func (s *Msg) Prepare(queryPrepared string) error {
|
|||||||
s.QueryPrepared = common.OrString(queryPrepared, s.QueryPrepared)
|
s.QueryPrepared = common.OrString(queryPrepared, s.QueryPrepared)
|
||||||
logrus.Printf("preparing %s body: %v", s.Gid, &s.MsgData)
|
logrus.Printf("preparing %s body: %v", s.Gid, &s.MsgData)
|
||||||
resp, err := common.RestyClient.R().SetBody(&s.MsgData).Post(fmt.Sprintf("%s/prepare", s.Server))
|
resp, err := common.RestyClient.R().SetBody(&s.MsgData).Post(fmt.Sprintf("%s/prepare", s.Server))
|
||||||
rerr := CheckDtmResponse(resp, err)
|
return CheckDtmResponse(resp, err)
|
||||||
if rerr != nil {
|
|
||||||
return rerr
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,9 @@ var TransProcessedTestChan chan string = nil
|
|||||||
|
|
||||||
// WaitTransProcessed only for test usage. wait for transaction processed once
|
// WaitTransProcessed only for test usage. wait for transaction processed once
|
||||||
func WaitTransProcessed(gid string) {
|
func WaitTransProcessed(gid string) {
|
||||||
|
if TransProcessedTestChan == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
logrus.Printf("waiting for gid %s", gid)
|
logrus.Printf("waiting for gid %s", gid)
|
||||||
id := <-TransProcessedTestChan
|
id := <-TransProcessedTestChan
|
||||||
for id != gid {
|
for id != gid {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user