Skip to content

Commit

Permalink
add periodic_task_name to headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryUbuntuNerd committed Nov 4, 2024
1 parent 5f0e38a commit 79d7360
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions django_celery_beat/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def __init__(self, model, app=None):
self.options['expires'] = getattr(model, 'expires_')

self.options['headers'] = loads(model.headers or '{}')
self.options['headers']['periodic_task_name'] = model.name
self.options['periodic_task_name'] = model.name

self.total_run_count = model.total_run_count
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_entry(self):
assert e.options['exchange'] == 'foo'
assert e.options['routing_key'] == 'cpu'
assert e.options['priority'] == 1
assert e.options['headers'] == {'_schema_name': 'foobar'}
assert e.options['headers'] == {'_schema_name': 'foobar', 'periodic_task_name': m.name}
assert e.options['periodic_task_name'] == m.name

right_now = self.app.now()
Expand Down

0 comments on commit 79d7360

Please sign in to comment.