Commit 9c7d5f7d authored by Administrator's avatar Administrator

[FIX] Asynchronous tasks ok for production.

parent 21252bd1
...@@ -27,7 +27,7 @@ CELERY_IMPORTS=("node.models",) ...@@ -27,7 +27,7 @@ CELERY_IMPORTS=("node.models",)
SECRET_KEY = 'bt)3n9v&a02cu7^^=+u_t2tmn8ex5fvx8$x4r*j*pb1yawd+rz' SECRET_KEY = 'bt)3n9v&a02cu7^^=+u_t2tmn8ex5fvx8$x4r*j*pb1yawd+rz'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = True
TEMPLATE_DEBUG = True TEMPLATE_DEBUG = True
......
...@@ -27,7 +27,7 @@ from parsing.FileParsers import * ...@@ -27,7 +27,7 @@ from parsing.FileParsers import *
# SOME FUNCTIONS # SOME FUNCTIONS
from gargantext_web.settings import DEBUG
from django.http import * from django.http import *
from django.shortcuts import render_to_response,redirect from django.shortcuts import render_to_response,redirect
from django.template import RequestContext from django.template import RequestContext
...@@ -263,9 +263,11 @@ def project(request, project_id): ...@@ -263,9 +263,11 @@ def project(request, project_id):
try: try:
#corpus.parse_and_extract_ngrams() #corpus.parse_and_extract_ngrams()
corpus.parse_and_extract_ngrams.apply_async((), countdown=3) #corpus.parse_and_extract_ngrams.apply_async((), countdown=3)
#corpus.workflow() if DEBUG is True:
#corpus.workflow((), countdown=3) corpus.workflow()
else:
corpus.workflow.apply_async((), countdown=3)
except Exception as error: except Exception as error:
print(error) print(error)
......
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