Timers not always being cleared when closing, causes hanging process
Created by: jeffijoe
I'm run into a weird issue with closing the queue.
When calling queue.close()
, it seems the timeout created by https://github.com/OptimalBits/bull/blob/master/lib/queue.js#L803 is not cleared (even though I can see in the code that it should be). I found this using wtfnode
as my Jest process would not exit.
Commenting out line 803 that creates the timer makes it work as expected.
Additionally, doing
queue.close().then(() => queue._clearTimers())
also fixes the issue. Perhaps running it again at the end of close
might be a good idea?