Files
zulip/tools/run-dev-queue-processors
Zev Benjamin 4c2800ef9d Start up queue processor workers in parallel with the rest of run-dev.py
Importing zerver.worker.queue_processors (which is needed to get the list of
workers to start) is slow because it, in turn, imports a bunch of stuff.  So we
move the process of starting up queue processing workers into another script
that gets started in parallel with everything else.

(imported from commit 839bada6dc7b93825c69b0d8fd9fbe2de75eabee)
2014-02-03 17:46:57 -05:00

21 lines
700 B
Python
Executable File

#!/usr/bin/env python
# This script is only meant to be run from run-dev.py, which sets up the
# environment correctly and passes the correct arguments for manage.py. It is a
# separate script so that the import from zerver.worker.queue_processors (which
# is slow) can be done in parallel with the rest of the work in bringing up the
# dev server.
import sys
import os
import subprocess
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from zerver.worker.queue_processors import get_active_worker_queues
queues = get_active_worker_queues()
args = ' '.join(sys.argv[1:])
for queue in queues:
subprocess.Popen('python manage.py process_queue %s %s' %(args, queue), shell=True)