Skip to content

Commit

Permalink
queue: wait for self to stop
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Apr 26, 2019
1 parent f30e975 commit 403b182
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion engine/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ func (q *Queue) Run() {
}

// Close stops the queue runner and releases queue assets
func (q *Queue) Close() { q.stopC <- true }
func (q *Queue) Close() {
q.stopC <- true
time.Sleep(time.Millisecond)
for !q.IsStopped() {
time.Sleep(time.Second)
}
}

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

0 comments on commit 403b182

Please sign in to comment.