Skip to content

Commit 403b182

Browse files
committed
queue: wait for self to stop
1 parent f30e975 commit 403b182

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

engine/queue/queue.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ func (q *Queue) Run() {
121121
}
122122

123123
// Close stops the queue runner and releases queue assets
124-
func (q *Queue) Close() { q.stopC <- true }
124+
func (q *Queue) Close() {
125+
q.stopC <- true
126+
time.Sleep(time.Millisecond)
127+
for !q.IsStopped() {
128+
time.Sleep(time.Second)
129+
}
130+
}
125131

126132
// IsStopped checks if the queue is still running and active
127133
func (q *Queue) IsStopped() bool {

0 commit comments

Comments
 (0)