bullmq
bullmq copied to clipboard
[Bug]: worker is not closing on Bun
Version
v4.11.0
Platform
NodeJS
What happened?
When using Bun 1.0.0, calling close on worker hangs indefinitely
How to reproduce.
import { Queue, Worker } from "bullmq"
export const bullMQBaseOptions = {
connection: {
host: "localhost",
port: 6379,
},
}
export const usersQueue = new Queue("users", bullMQBaseOptions)
export const usersWorker = new Worker(
"users",
async (job) => {},
bullMQBaseOptions,
)
usersQueue.add("users-cleanup", null, {
repeat: {
every: 10000,
},
})
setTimeout(async () => {
console.log("should close")
await Promise.all([usersQueue.close(), usersWorker.close()])
console.log("closed")
}, 2000)
Relevant log output
❯ bun ./bin/worker.js
[0.02ms] ".env"
should close
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thanks for reporting this. I removed the Bug label as Bun is not officially supported yet https://github.com/taskforcesh/bullmq/issues/2177
With the latest version of Bun (1.1.9) this seems to have been fixed