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 {
|
||||
return false
|
||||
}
|
||||
if TransProcessedTestChan != nil {
|
||||
defer WaitTransProcessed(trans.Gid)
|
||||
}
|
||||
trans.Process(dbGet())
|
||||
return true
|
||||
}
|
||||
|
||||
@ -38,9 +38,6 @@ var TransProcessedTestChan chan string = nil
|
||||
|
||||
// WaitTransProcessed only for test usage. wait for transaction processed once
|
||||
func WaitTransProcessed(gid string) {
|
||||
if TransProcessedTestChan == nil {
|
||||
return
|
||||
}
|
||||
logrus.Printf("waiting for gid %s", gid)
|
||||
id := <-TransProcessedTestChan
|
||||
for id != gid {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user