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
When passing name to worker options, it's supposed to show this name on the job.processedBy property. It works for the first time but doesn't for all sequentially runs. It can be reproduced only when there is a timeout inside worker function.
How to reproduce.
queue.ts
import { Queue } from "bullmq"
const q = new Queue("super-task", { connection: { url: "localhost" } })
while (true) {
await q.add("super-task", {})
await new Promise((res) => setTimeout(res, 5000))
}
worker.ts
import { Worker } from "bullmq"
new Worker(
"super-task",
async (job) => {
console.log(job.processedBy) // <- job.processedBy is undefined after second run
await new Promise((resolve) => setTimeout(resolve, 5000))
},
{
connection: { url: "localhost" },
name: "processedBy-custom-name",
},
)
Relevant log output
processedBy-custom-name
undefined
undefined
...
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
dimonnwc3
changed the title
[Bug]: job.processedBy is undefined after second worker call
[Bug]: job.processedBy is undefined after second worker run
Feb 12, 2025
Version
v5.40.2
Platform
NodeJS
What happened?
When passing
name
to worker options, it's supposed to show this name on thejob.processedBy
property. It works for the first time but doesn't for all sequentially runs. It can be reproduced only when there is a timeout inside worker function.How to reproduce.
queue.ts
worker.ts
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: