Reputation: 35
I have a mission to make a background task in Django, I tried with celery but I didn't have success.
What I have to do? I need after the person wrote the number in input and pressed submit button, for example 100, the 1% of it will be added every second to his previous number during the 1 day.
Can you help me draw the code what it looks like? With celery, django-background-task or others doesn't matter, the main importance that it needs to be certain number of tasks simultaneously, for every user his background task
Upvotes: 0
Views: 689
Reputation: 860
you could use a package called django-background-tasks
and your function will be like this:
from background_task import background
@background(schedule=60)
def add(input): # this function will run every 60 seconds
input += (input*0.01)
link for the package docs
Upvotes: 1