You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Celery Beat currently does not provide any metadata in the task.request object to indicate that a task was scheduled by Beat. This makes it impossible to differentiate between a manually triggered task (.delay() or .apply_async()) and a Beat-scheduled task without adding a custom kwargs parameter.
Set up Celery Beat (your producer) with a schedule to trigger the task. Also, create a prerun.connect method so we can compare logging from the different sources.
Finally, wait for the producer to trigger the task.
Capture the logs of both and compare.
Expected Behavior
Celery Beat should provide some metadata (e.g., a celerybeat: true header or a specific delivery_info field) to distinguish Beat-scheduled tasks from manually triggered ones.
Description
Celery Beat currently does not provide any metadata in the task.request object to indicate that a task was scheduled by Beat. This makes it impossible to differentiate between a manually triggered task (.delay() or .apply_async()) and a Beat-scheduled task without adding a custom kwargs parameter.
Steps to Reproduce
Set up a simple task for your worker to handle.
Set up Celery Beat (your producer) with a schedule to trigger the task. Also, create a prerun.connect method so we can compare logging from the different sources.
In a python console, trigger the task manually.
Finally, wait for the producer to trigger the task.
Capture the logs of both and compare.
Expected Behavior
Celery Beat should provide some metadata (e.g., a celerybeat: true header or a specific delivery_info field) to distinguish Beat-scheduled tasks from manually triggered ones.
Actual Behavior
The request object is identical in both cases:
Request object from manual triggering:
Request object from beat triggering:
Proposed Solution
Environment
Celery v5.4.0
Django Celery Beat v2.7.0
Broker: Redis
Backend: Redis
The text was updated successfully, but these errors were encountered: