Refactoring fetcher, working feeds and raw url writer
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import django_rq
|
||||
from django.http import JsonResponse
|
||||
from .tasks import task_1
|
||||
from .tasks import background_task
|
||||
|
||||
def trigger_task(request):
|
||||
"""View that enqueues a task."""
|
||||
queue = django_rq.get_queue('default') # Get the default queue
|
||||
job = queue.enqueue(task_1, "Hello from Django RQ!")
|
||||
job = queue.enqueue(background_task, "Hello from Django RQ!")
|
||||
|
||||
return JsonResponse({"message": "Task has been enqueued!", "job_id": job.id})
|
||||
|
||||
Reference in New Issue
Block a user