M
M
Maxim2020-12-09 10:24:08
Django
Maxim, 2020-12-09 10:24:08

How to dynamically create scheduled tasks in django?

Good afternoon. I can't figure out how to organize a dynamic queue of background tasks.
The work algorithm is as follows:
1. There are a certain number of certain jobs that are stored in the Workplaces model
2. There are a number of prepared tasks that accept a parameter indicating this workplace
3. I found the django_celery_beat package, which just creates tasks from the database.
But this package doesn't work quite the way I expected. It creates global tasks, but I need to manage tasks in the context of workplaces independently, i.e. for each workplace there can be the same tasks, but the schedule may differ, I also want to receive all its tasks from the workplace object by links and manage them.
Did I find the right package or is there a way around this limitation?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-12-09
@maxpointn2point

The package is correct, it allows you to schedule tasks with certain arguments. In your case, the tasks are the same, but the arguments are different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question