Switching to django celery for workers
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import os
|
||||
from .tasks import background_task
|
||||
from django.http import JsonResponse, HttpResponse
|
||||
from django.db import connection
|
||||
|
||||
####################################################################################################
|
||||
"""
|
||||
### from .tasks import background_task
|
||||
|
||||
def trigger_task(request, task):
|
||||
# Enqueue function in "default" queue
|
||||
background_task.delay(task)
|
||||
return JsonResponse({"message": "Task has been enqueued!", "task": task})
|
||||
"""
|
||||
|
||||
####################################################################################################
|
||||
def link_list(request):
|
||||
# Base URL path
|
||||
app_url = request.build_absolute_uri()
|
||||
@@ -19,8 +21,8 @@ def link_list(request):
|
||||
# List of links
|
||||
list_links = \
|
||||
[ os.path.join(app_url, "admin"), os.path.join(app_url, "urls") ] + \
|
||||
[ os.path.join(app_url, "logs", log_type) for log_type in ["database", "debug", "info", "warning"] ] + \
|
||||
[ os.path.join(app_url, "task", l) for l in links_fetch + links_process ]
|
||||
[ os.path.join(app_url, "logs", log_type) for log_type in ["database", "debug", "info", "warning"] ] #+ \
|
||||
#[ os.path.join(app_url, "task", l) for l in links_fetch + links_process ]
|
||||
|
||||
# Links tuple
|
||||
links = [(l, l) for l in list_links]
|
||||
@@ -32,6 +34,7 @@ def link_list(request):
|
||||
|
||||
return HttpResponse(html)
|
||||
|
||||
|
||||
####################################################################################################
|
||||
def logs(request, log_type):
|
||||
# Capture output: python manage.py rqstats
|
||||
|
||||
Reference in New Issue
Block a user