worker.getNextJob timeout
Is your feature request related to a problem? Please describe.
The current worker.getNextJob is either blocking (default) or non-blocking. the problem is that the blocking version does not have a configurable timeout to release the lock. if we await for this, it'll be forever
Describe the solution you'd like
a timeout option for when block is true
Describe alternatives you've considered
passing block: false and harassing the server in a loop with await setTimeout in between to tame the worker
There is actually a timeout which is by default 10 seconds: https://api.docs.bullmq.io/interfaces/v5.WorkerOptions.html#drainDelay
@manast i would expect that it should rather be a local timeout setting in the 2nd param of getNextJob. for example:
getNextJob: (blockingUntil: number | false = 10_000) => Promise<Job | undefined>
that is: call is blocking by default, timeout at 10s. you can pass a different number to set the timeout locally, or false for non blocking (or 0 maybe, but less intuitive)