change Chan test
This commit is contained in:
parent
0c7913fef1
commit
252d7862f4
@ -16,7 +16,9 @@ func CronTransOnce(expireIn time.Duration) bool {
|
|||||||
if trans == nil {
|
if trans == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
defer WaitTransProcessed(trans.Gid)
|
if TransProcessedTestChan != nil {
|
||||||
|
defer WaitTransProcessed(trans.Gid)
|
||||||
|
}
|
||||||
trans.Process(dbGet())
|
trans.Process(dbGet())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,9 +38,6 @@ 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