level-jobs icon indicating copy to clipboard operation
level-jobs copied to clipboard

pattern for deleting a failed job?

Open myf opened this issue 8 years ago • 3 comments

was trying to use it to delete a failed job after a maxretry, with the event "error" I can retrieve the error message but not the jobId. What would be the recommended way to delete something once it's errored?

myf avatar Sep 13 '16 17:09 myf

I think the job should be deleted from the pending db once the maximum number of retries is reached. https://github.com/pgte/level-jobs/blob/master/server.js#L158

manishbhatias avatar Apr 11 '17 19:04 manishbhatias

Right now, the queue only emits an error. We could augment the error with the payload. Will accept PR with this feature.

pgte avatar Jun 26 '17 11:06 pgte

I also have the problem of jobs still failing after maxRetries trials which are crashing my node.js process!! I don't really understand the logic^^, since this is blocking the whole queue which could be potentially catastrophic for some applications... Please write a warning in the documentation page about such behavior. Would it be possible to add an option or indicate a way to properly just throw a warning (and not an error) in such a case (maxRetries reached) please?

I am also in favor of manishbhatias solution above of deleting the job instead of throwing an error: https://github.com/pgte/level-jobs/blob/master/server.js#L158 What would be the proper way to do that please ?

Thanks a lot in advance, and thanks for this nice package

BoussonNicolas avatar Jan 22 '18 17:01 BoussonNicolas