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
Problem
If we let BullMQ creates the connection to Redis we get some errors from jest and it detect open handles that are pointed to the open Redis connection.
it('should get job after creating the job',async()=>{constjob=awaitpaintQueue.add('jobName','data',{removeOnComplete: false,removeOnFail: false})expect(job).toBeTruthy()})
The workaround that I use for now is to create the connection outside the queue and expose it:
Thanks a lot. The problem was probably ts definitions. Now I am calling close function and I have to ignore the typescript compiler because of this error:
Property 'close' does not exist on type 'Queue<any, any, string> | { add: (...args: any[]) => Promise<string>; }'.
Property 'close' does not exist on type '{ add: (...args: any[]) => Promise<string>; }'
BullMQ Version:
^2.1.3
Problem
If we let
BullMQ
creates the connection toRedis
we get some errors fromjest
and it detect open handles that are pointed to the open Redis connection.A test that I use and get error of open handles:
The workaround that I use for now is to create the connection outside the queue and expose it:
Now I can solve this error by adding this:
The problem is that the only exposed function is
add
and there is no way you can close the redis connection.For the Worker case when you call
disconnect
it gracefully ends the redis connection and you see no errors.Suggestion:
Exposing a
disconnect
function similar to Worker for closing a QueueAny help or suggestion is appreciated, Or if someone has any idea I would be happy to help to solve it.
The text was updated successfully, but these errors were encountered: