-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
onComplete alternative #517
Comments
onComplete was removed in v10 and I'm not currently planning on bringing them back. Dead letter queues handle the majority use case of orchestration of the failure completion state. |
You mention dead letter queues but that would only be able to handle performing actions when jobs fail correct? So there isn't any way to handle successful job lifecycles on a queue in any way for the foreseeable future? |
@lramirez925 - I also needed this functionality and implemented a workaround. My goal was to track the success, failure, and retry metrics for each of my jobs. To achieve this, I created a wrapper function that surrounds each job before instantiation. This wrapper awaits the execution of the actual job handler, catching and re-throwing any errors that occur to retain pg-boss error handling functionality. Depending on the outcome (success or error), the wrapper then creates a new job dedicated to monitoring the job state. From my experience, while pg-boss DLQs are effective for handling failed jobs, they fall short in tracking successful and retried jobs. An |
Looking at upgrading to v10, but having issues wrapping my head around how to replace my onComplete scenario. Is that flow no longer supported at all going forward or am I just blind?
Currently I have workflow system that adds an "onComplete" that looks up the next job to run and schedules it. I prefer to have it separate from the actual job code. Just making sure I am not missing a new similar flow that I could use before rebuilding it.
The text was updated successfully, but these errors were encountered: