Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
6a160d83
Commit
6a160d83
authored
Apr 07, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Async ok for basic workflow.
parent
3d93b228
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
28 deletions
+50
-28
celery.py
gargantext_web/celery.py
+27
-27
settings.py
gargantext_web/settings.py
+22
-0
views_optimized.py
gargantext_web/views_optimized.py
+1
-1
No files found.
gargantext_web/celery.py
View file @
6a160d83
# -*- coding: utf-8 -*-
import
os
import
djcelery
from
celery
import
Celery
from
django.conf
import
settings
# set the default Django settings module for the 'celery' program.
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'gargantext_web.settings'
)
app
=
Celery
(
'gargantext_web'
)
app
.
conf
.
update
(
CELERY_RESULT_BACKEND
=
'djcelery.backends.database:DatabaseBackend'
,
)
app
.
conf
.
update
(
CELERY_RESULT_BACKEND
=
'djcelery.backends.cache:CacheBackend'
,
)
# Using a string here means the worker will not have to
# pickle the object when using Windows.
#app.config_from_object('django.conf:settings')
app
.
autodiscover_tasks
(
lambda
:
settings
.
INSTALLED_APPS
)
#
import os
#
import djcelery
#
#
from celery import Celery
#
#
from django.conf import settings
#
#
#
set the default Django settings module for the 'celery' program.
#
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gargantext_web.settings')
#
#
app = Celery('gargantext_web')
#
#
#
app.conf.update(
#
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
#
)
#
#
#
app.conf.update(
#
CELERY_RESULT_BACKEND='djcelery.backends.cache:CacheBackend',
#
)
#
#
#
Using a string here means the worker will not have to
#
#
pickle the object when using Windows.
#
#
app.config_from_object('django.conf:settings')
#
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
#
from
celery
import
shared_task
#@app.task(bind=True)
...
...
gargantext_web/settings.py
View file @
6a160d83
...
...
@@ -14,12 +14,34 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_PATH
=
os
.
path
.
join
(
BASE_DIR
,
os
.
pardir
)
PROJECT_PATH
=
os
.
path
.
abspath
(
PROJECT_PATH
)
######################################################################
# ASYNCHRONOUS TASKS
import
djcelery
djcelery
.
setup_loader
()
BROKER_URL
=
'amqp://guest:guest@localhost:5672/'
CELERY_IMPORTS
=
(
"node.models"
,
"gargantext_web.celery"
)
#
#from celery import Celery
#
#app = Celery('gargantext_web')
#
#app.conf.update(
# CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
#)
#
#
#app.conf.update(
# CELERY_RESULT_BACKEND='djcelery.backends.cache:CacheBackend',
#)
#
######################################################################
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
...
...
gargantext_web/views_optimized.py
View file @
6a160d83
...
...
@@ -144,7 +144,7 @@ def project(request, project_id):
)
# let's start the workflow
try
:
if
DEBUG
is
not
True
:
if
DEBUG
is
True
:
apply_workflow
.
apply_async
((
corpus
.
id
,),)
else
:
#apply_workflow(corpus)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment