Exemple #1
0
 def cleartask(self, request):
     # Given a single task ID, clear it from the queue
     task_id = request.data.get("task_id")
     if task_id:
         queue.clear_job(task_id)
         return Response({"task_id": task_id})
     else:
         return Response({})
Exemple #2
0
 def deletefinishedtasks(self, request):
     """
     Delete all tasks that have succeeded, failed, or been cancelled.
     """
     task_id = request.data.get("task_id")
     if task_id:
         queue.clear_job(task_id)
     else:
         queue.clear()
     return Response({})