Commit 3c0c144d authored by Janez K's avatar Janez K

dodal flag USE_CONCURRENCY

parent 8297545a
......@@ -15,6 +15,8 @@ DATABASES = {
}
}
USE_CONCURRENCY = False
# Make this unique, and don't share it with anybody.
SECRET_KEY = '*f$)twxl*rdk*o@^j%^0f0r#z7=kkyw=-2v*rjdnon_j==1uw@'
......
......@@ -123,23 +123,6 @@ FIXTURE_DIRS = (
os.path.join(PROJECT_DIR, 'fixtures'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'workflows',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
......@@ -178,6 +161,42 @@ except NameError:
except ImportError:
pass
if USE_CONCURRENCY:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'workflows',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
'djcelery',
)
else:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'workflows',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
)
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS
TEMPLATES_FOLDER = os.path.join(PROJECT_DIR, 'templates')
......
-r requirements.txt
celery==2.5.3
redis==2.4.11
django-celery==2.5.5
django-celery-with-redis==2.5
......@@ -10,8 +10,9 @@ from picklefield.fields import PickledObjectField
from workflows.thumbs import ThumbnailField
from mothra.settings import DEBUG
from mothra.settings import USE_CONCURRENCY
if not DEBUG:
if USE_CONCURRENCY:
from workflows.tasks import runWidgetAsync, runForLoopIteration
class Connection(models.Model):
......@@ -107,7 +108,7 @@ class Workflow(models.Model):
proper_output.save()
fi.finished=True
fi.save()
if DEBUG or 1==1:
if not USE_CONCURRENCY or 1==1:
unfinished_list = self.get_runnable_widgets()
try:
while len(unfinished_list)>0:
......@@ -157,7 +158,7 @@ class Workflow(models.Model):
current_iteration = current_iteration+1
def run(self):
if DEBUG or not self.widget:
if not USE_CONCURRENCY or not self.widget:
unfinished_list = self.get_runnable_widgets()
try:
total = self.widgets.count()
......
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