Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. from celery.decorators import task
  2. from django.core.cache import cache
  3.  
  4. @task
  5. def do_job(path):
  6. "Performs an operation on a file"
  7.  
  8. # ... Code to perform the operation ...
  9.  
  10. cache.set(current_task_id, operation_results)
  11.  
  12. @task
  13. def do_job(path, task_id=None):
  14. cache.set(task_id, operation_results)
  15.  
  16. @task
  17. def do_job(path):
  18. cache.set(do_job.request.id, operation_results)
  19.  
  20. @task(bind=True)
  21. def do_job(self, path):
  22. cache.set(self.request.id, operation_results)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement