瀏覽代碼

queue clear

marion 4 年之前
父節點
當前提交
f16b8090d4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      utils/queue/queue_clear.go

+ 1 - 1
utils/queue/queue_clear.go

@@ -17,10 +17,10 @@ func (i *Clear) Clean(queue chan interface{}) {
 
 	for {
 		if len(queue) == 0 {
-			time.Sleep(1 * time.Millisecond) // set a little gap between Clean() and clear.Working() off
 			i.set(false)
 			break
 		}
+		time.Sleep(1 * time.Millisecond) // set a little gap between every loop and between Clean() and clear.Working() off
 	}
 }