Commit 15129f91 authored by Anze Vavpetic's avatar Anze Vavpetic

added a global flag for disabling the windows queue

parent 2c2a44c0
......@@ -59,3 +59,4 @@ import sys
reload(sys)
sys.setdefaultencoding('utf8')
USE_WINDOWS_QUEUE = False
......@@ -181,21 +181,11 @@ INSTALLED_APPS_WORKFLOWS_SUB = ()
TEST_RUNNER = 'discover_runner.DiscoverRunner'
USE_WINDOWS_QUEUE = True
import djcelery
djcelery.setup_loader()
try:
LOCAL_SETTINGS
except NameError:
try:
from local_settings import *
except ImportError:
pass
INSTALLED_APPS = \
INSTALLED_APPS_DEFAULT +\
INSTALLED_APPS_WORKFLOWS_SUB
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
'DEFAULT_AUTHENTICATION_CLASSES': (
......@@ -224,3 +214,15 @@ STATIC_DOC_ROOT = os.path.join(os.getcwd(), 'mothra/public/media')
CELERY_RESULT_BACKEND = 'amqp'
CELERY_TASK_RESULT_EXPIRES = 18000
try:
LOCAL_SETTINGS
except NameError:
try:
from local_settings import *
except ImportError:
pass
INSTALLED_APPS = \
INSTALLED_APPS_DEFAULT +\
INSTALLED_APPS_WORKFLOWS_SUB
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.conf import settings
import workflows.library
import time
......@@ -569,7 +570,7 @@ class Widget(models.Model):
def run(self,offline):
""" This is only a hack, to make this work on windows """
try:
if self.abstract_widget.windows_queue:
if self.abstract_widget.windows_queue and settings.USE_WINDOWS_QUEUE:
t = runWidget.apply_async([self,offline],queue="windows")
t.wait()
else:
......@@ -858,7 +859,7 @@ class Widget(models.Model):
input_dict[i.variable].append(i.value)
try:
if not self.abstract_widget is None:
if self.abstract_widget.windows_queue:
if self.abstract_widget.windows_queue and settings.USE_WINDOWS_QUEUE:
t = executeWidgetPostInteract.apply_async([self,input_dict,output_dict,request],queue="windows")
outputs = t.wait()
else:
......
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