Working fetch search, refactoring DB towards source search
This commit is contained in:
@@ -9,11 +9,22 @@ logger = get_logger()
|
||||
|
||||
def trigger_task(request, task):
|
||||
"""View that enqueues a task."""
|
||||
|
||||
"""
|
||||
if ("fetch_" in task):
|
||||
priority = "low"
|
||||
job_timeout="30m"
|
||||
elif ("process_" in task):
|
||||
priority = "medium"
|
||||
job_timeout="30m"
|
||||
"""
|
||||
|
||||
queue = django_rq.get_queue('default') # Get the default queue
|
||||
job = queue.enqueue(background_task, task)
|
||||
job = queue.enqueue(background_task, task, job_timeout="30m")
|
||||
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", "process_missing_kids_urls_50", "process_missing_kids_urls_500000"]
|
||||
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]})
|
||||
links = ["fetch_feeds", "fetch_parser", "fetch_search", "process_raw_urls_50", "process_error_urls_50", "process_missing_kids_urls_50", "process_missing_kids_urls_500000"]
|
||||
db_links = ["http://localhost:8080/?pgsql=matitos_db&username=supermatitos&db=matitos&ns=public&select=urls&order%5B0%5D=id&limit=500"]
|
||||
return JsonResponse({"links": db_links + [os.path.join(prefix, l) for l in links]})
|
||||
|
||||
Reference in New Issue
Block a user