From e5470b2b66e35a68762cdb3cbbbadc34418b6643 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 23 Oct 2013 13:12:03 -0400 Subject: [PATCH] Run queue processor workers from run-dev.py (imported from commit d8977fbb899bf4a1b7e3a644a9259279ac744efd) --- tools/run-dev.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/run-dev.py b/tools/run-dev.py index 837eeae136..15e7fc0fea 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -3,6 +3,7 @@ import optparse import subprocess import signal import traceback +import sys import os from os import path @@ -43,7 +44,15 @@ base_port = 9991 manage_args = '' if options.test: base_port = 9981 - manage_args = '--settings=zproject.test_settings' + settings_module = "zproject.test_settings" +else: + settings_module = "zproject.settings" + +manage_args = '--settings=%s' % (settings_module,) +os.environ['DJANGO_SETTINGS_MODULE'] = settings_module + +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) +from zerver.worker.queue_processors import get_active_worker_queues proxy_port = base_port django_port = base_port+1 @@ -61,10 +70,14 @@ os.setpgrp() # Pass --nostatic because we configure static serving ourselves in # zulip/urls.py. -for cmd in ['python manage.py runserver --nostatic %s localhost:%d' - % (manage_args, django_port), - 'python manage.py runtornado %s localhost:%d' - % (manage_args, tornado_port)]: +cmds = ['python manage.py runserver --nostatic %s localhost:%d' + % (manage_args, django_port), + 'python manage.py runtornado %s localhost:%d' + % (manage_args, tornado_port)] +for queue in get_active_worker_queues(): + cmds.append('python manage.py process_queue %s %s' %(manage_args, queue)) + +for cmd in cmds: subprocess.Popen(cmd, shell=True) class Resource(resource.Resource):