You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If bclient hasn't been initialized yet, then we're connecting for no reason.
Minimal, Working Test code to reproduce the issue.
constQueue=require('bull');constRedis=require('ioredis');constqueue=newQueue('foo',{createClient(type){if(type==='bclient'){// enforce that we don't waste connections for read-only queuesthrownewError('This queue is read-only');}returnnewRedis();}});queue.whenCurrentJobsFinished();
Bull version
develop branch
Additional information
Also reproducible when calling queue.pause(true) since that calls whenCurrentJobsFinished internally. Workaround for that is to call queue.pause(true, true) so that whenCurrentJobsFinished is not called. But that only works if you're sure there are no jobs to wait for.
The text was updated successfully, but these errors were encountered:
Description
Bull typically does a good job of lazily connecting to Redis. But the following code causes the blocking client to be initialized unnecessarily:
bull/lib/queue.js
Lines 1140 to 1147 in c0ee6be
If
bclient
hasn't been initialized yet, then we're connecting for no reason.Minimal, Working Test code to reproduce the issue.
Bull version
develop
branchAdditional information
Also reproducible when calling
queue.pause(true)
since that callswhenCurrentJobsFinished
internally. Workaround for that is to callqueue.pause(true, true)
so thatwhenCurrentJobsFinished
is not called. But that only works if you're sure there are no jobs to wait for.The text was updated successfully, but these errors were encountered: