Commit 9c2a9c75 authored by Administrator's avatar Administrator

[BUG FIX] Async tasks

	modifié :         gargantext_web/views_optimized.py
	please do not remove async !

	supprimé :        gargantext_web/tasks.py
	useless now
parent 649b7a48
from celery import shared_task
from parsing.corpustools import add_resource, parse_resources, extract_ngrams, compute_tfidf
@shared_task
def apply_workflow(corpus):
parse_resources(corpus)
extract_ngrams(corpus, ['title'])
compute_tfidf(corpus)
...@@ -159,7 +159,7 @@ def project(request, project_id): ...@@ -159,7 +159,7 @@ def project(request, project_id):
# let's start the workflow # let's start the workflow
try: try:
if DEBUG is False: if DEBUG is False:
apply_workflow((corpus.id,),) apply_workflow.apply_async((corpus.id,),)
else: else:
#apply_workflow(corpus) #apply_workflow(corpus)
thread = Thread(target=apply_workflow, args=(corpus.id, ), daemon=True) thread = Thread(target=apply_workflow, args=(corpus.id, ), daemon=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment