Skip to content
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

updateProgress doesn't work with REPEATABLE jobs #1484

Closed
happyhunter7 opened this issue Oct 18, 2022 · 1 comment
Closed

updateProgress doesn't work with REPEATABLE jobs #1484

happyhunter7 opened this issue Oct 18, 2022 · 1 comment

Comments

@happyhunter7
Copy link

happyhunter7 commented Oct 18, 2022

I have a repeatable job and I'm trying to set some progress using this method updateProgress which is an argument in the worker.

code:

updateProgress(50)

And for some reason that throw this error

TypeError: Cannot set properties of undefined (setting 'progress')

From the logs I have it shows that the error happens in this file which is part of bullmq on line(450).

TypeError: Cannot set properties of undefined (setting 'progress')
    at updateProgress (/node_modules/bullmq/src/classes/job.ts:450:18)

Can someone help me with that..! How can I update progress for repeatable jobs?

@happyhunter7
Copy link
Author

Hah) found the error.. It has nothing to do with BullMq

I was getting this method from job using JS destructurization

{ updateProgress }

and it lost the reference to the Job instance

so I updated the code to use '.' which refers to job instance

job.updateProgress() // Works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant