Working fetch feeds and parser, process raw and error urls
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import django_rq
|
||||
from django.http import JsonResponse
|
||||
from .tasks import background_task
|
||||
import os
|
||||
from .src.logger import get_logger
|
||||
logger = get_logger()
|
||||
|
||||
@@ -9,3 +10,8 @@ def trigger_task(request, task):
|
||||
queue = django_rq.get_queue('default') # Get the default queue
|
||||
job = queue.enqueue(background_task, task)
|
||||
return JsonResponse({"message": "Task has been enqueued!", "job_id": job.id})
|
||||
|
||||
def link_list(request):
|
||||
prefix = "http://localhost:8000/api"
|
||||
links = ["fetch_feeds", "fetch_parser", "process_raw_urls", "process_error_urls"]
|
||||
return JsonResponse({"links": ["http://localhost:8080/?pgsql=matitos_db&username=supermatitos&db=matitos&ns=public&select=urls&order%5B0%5D=id"] + [os.path.join(prefix, l) for l in links]})
|
||||
|
||||
Reference in New Issue
Block a user