-
Notifications
You must be signed in to change notification settings - Fork 429
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
Fix for missing periodic task name in results #812
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add unit tests please?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
==========================================
- Coverage 86.92% 86.83% -0.10%
==========================================
Files 32 32
Lines 933 934 +1
Branches 124 74 -50
==========================================
Hits 811 811
- Misses 103 105 +2
+ Partials 19 18 -1 ☔ View full report in Codecov by Sentry. |
Linting errors in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends on celery/django-celery-results#445 (review)
Fix for issue #376 in django-celery-results. The message broker rabbitmq isn't picking up
periodic_task_name
when it's passed as a keyword arg totask.apply_async()
. If it's added to theheaders
inapply_async()
it becomes available in therequest
object in django-celery-results. For this change to work the following commit also needs to be merged, otherwise it won't get picked up in the results.If the task isn't triggered by django-celery-beat, but is done with code, such as using
delay()
orapply_async()
, it will be missing, unless it's added to the headers inapply_async()
. delay() doesn't support the extra options. E.g. When triggering a child task withdelay()
Periodic Task Name was missing in the Task Results.These changes haven't been tested with Redis or any other message broker, only rabbitmq.
CELERY_RESULT_EXTENDED
was set toTrue
in the settings.Tested with:
celery==5.4.0
django-celery-beat==2.7.0
django-celery-results==2.5.1
Django==4.2.16
rabbitmq==4.0.2