django-background-tasks icon indicating copy to clipboard operation
django-background-tasks copied to clipboard

Tasks sequencial execution

Open diegobill opened this issue 4 years ago • 2 comments

Is there someway to schedule tasks and the execution happens sequentially (as a queue, fist in first out)? The second tasks should be processed only after the first one finish. The tasks should have a dependency based on the previous tasks (on the same queue) finish first.

diegobill avatar Apr 08 '20 12:04 diegobill

I tried to handle this using the code actually. When the first task has ended, I called the function that triggers the second task.

@background(schedule=1)
def task1():
    # Do something
    task2();

@background(schedule=1)
def task2():
    # Do the remainder 

masudias avatar Jun 26 '20 00:06 masudias

@masudias , in my use case the event to schedule the task 1 and 2 are independent, so I can not schedule que task 2 during the execution of the task 1.

diegobill avatar Jun 26 '20 01:06 diegobill