-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Adds after_job_end hook #355
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #355 +/- ##
=======================================
Coverage 98.80% 98.80%
=======================================
Files 9 9
Lines 917 920 +3
Branches 166 167 +1
=======================================
+ Hits 906 909 +3
Misses 6 6
Partials 5 5
Continue to review full report at Codecov.
|
What happens if this task has an exception? |
|
Probably more specifically, it would be nice to see something like this (abbreviated, but hopefully you understand what I mean): async def run_job(...):
....
async def job_wrapper():
await on_job_start(ctx)
await function.coroutine(ctx, *args, **kwargs)
await on_job_end(ctx)
await asyncio.shield(before_job_start(ctx))
await self.loop.create_task(job_wrapper())
await await asyncio.shield(self.finish_job())
await asyncio.shield(after_job_end(ctx)) This would allow for:
|
@AngellusMortis LGTM, could you resolve conflicts. |
d4aa259
to
3564376
Compare
Fixed. |
thanks so much. |
Adds an additional hook for after the job completes. Useful for doing something after the results for the job has been recorded.
My specific use case is I am adding New Relic integration into arq for our projects. Being able to record the success/failure, queue time, etc. of a job directly to New Relic is very useful.