Skip to content

feat: add periodic_task_name in favor of celery/django-celery-results#261#477

Merged
auvipy merged 3 commits intocelery:masterfrom
lvelvee:feat-periodic-task-name
Dec 17, 2021
Merged

feat: add periodic_task_name in favor of celery/django-celery-results#261#477
auvipy merged 3 commits intocelery:masterfrom
lvelvee:feat-periodic-task-name

Conversation

@lvelvee
Copy link
Copy Markdown

@lvelvee lvelvee commented Dec 15, 2021

celery/django-celery-results#261

Now you can store PeriodicTask.name to django-celery-results (TaskResult.periodic_task_name).

Suppose we have two periodic tasks, their schedules are different, but the tasks are the same.

name task args schedule
schedule1 some.celery.task (1,) every hour
schedule2 some.celery.task (2,) every 2 hours

Now you can distinguish the source of the task from the results by the periodic_task_name field.

id task_name periodic_task_name
uuid1 some.celery.task schedule1
uuid2 some.celery.task schedule1
uuid3 some.celery.task schedule2
uuid4 some.celery.task schedule2

celery beat will add PeriodicTask.name to requests when scheduled by database or manually scheduled by admin panel.

@lvelvee lvelvee changed the title feat: add periodic_task_name in favor of https://github.com/celery/django-celery-results/pull/261 feat: add periodic_task_name in favor of celery/django-celery-results#261 Dec 15, 2021
Comment thread django_celery_beat/schedulers.py
Comment thread docs/includes/introduction.txt Outdated
-----------------------------------

Now you can store PeriodicTask.name to django-celery-results (TaskResult.periodic_task_name).
(more details here: https://github.com/celery/django-celery-beat/pull/477, https://github.com/celery/django-celery-results/pull/261)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should add more text and example with the links provided

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added, but i'm not familiar with .rst files, may you help to check it?

Copy link
Copy Markdown
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats good work. thanks

@auvipy auvipy merged commit 77a6ccf into celery:master Dec 17, 2021
@lvelvee lvelvee deleted the feat-periodic-task-name branch December 17, 2021 08:02
@auvipy auvipy added this to the v2.3.0 milestone Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants