New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Connection is closed.
for shared connection
#1218
Comments
With Queue, since the connection is shared it cannot be avoided, if you close the connection then the Queue will fail. The solution is to not share the connection if you need to call quit on that given client. |
Hi @manast, since 1.8.2, i'm also getting these on Heroku. Local development seems fine so maybe something with the Heroku redis version? im not calling redis.quit() or queue.close(). What's weird is that everything still works (I think) but just the logs keep showing up as below.
Bit confused about the work Worker/Queue thing, but I am using it like this:
// redis
import Redis from "ioredis"
export const redis = new Redis(REDIS_URL, { maxRetriesPerRequest: null, enableReadyCheck: false })
// queue setup
export const WORKER_KEY = "TEST1"
new QueueScheduler(WORKER_KEY, { connection: redis })
export const userQueue = new Queue(WORKER_KEY, { connection: redis })
// somewhere
userQueue.add(
// stuff
)
// worker processing
new Worker(
WORKER_KEY,
async (job: Jobs) => {
// process stuff
},
{ connection: redis },
) spot anything I could be doing wrong? I've got multiple queue's workers as well |
Sorry I do not see anything in that code that would explain the log you posted above, particularly there are no calls to close or quit so it is strange. But definitely not related to Heroku's Redis version. |
We're experiencing a similar issue:
|
I got this error if I use
redis.quit
to close the connection instead ofqueue.close
.I found a similar issue for that (#670).
It seems fixed the problem with Worker but the Queue will still encounter this problem.
The text was updated successfully, but these errors were encountered: