Add an IS_WORKER setting that is True when the current process is a worker

(imported from commit f8976b8345e9c709c2336a17d18260130f3f2562)
This commit is contained in:
Zev Benjamin 2014-01-07 16:27:52 -05:00
parent db23674749
commit ced2f86fd7
1 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,11 @@ if not 'DEBUG' in globals():
TEMPLATE_DEBUG = DEBUG
TEST_SUITE = False
if len(sys.argv) > 2 and sys.argv[0].endswith('manage.py') and sys.argv[1] == 'process_queue':
IS_WORKER = True
else:
IS_WORKER = False
if DEBUG:
INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or ENTERPRISE:
@ -626,7 +631,7 @@ for (var, path) in ZULIP_PATHS:
ZULIP_WORKER_TEST_FILE = '/tmp/zulip-worker-test-file'
if len(sys.argv) > 2 and sys.argv[0].endswith('manage.py') and sys.argv[1] == 'process_queue':
if IS_WORKER:
FILE_LOG_PATH = WORKER_LOG_PATH
else:
FILE_LOG_PATH = SERVER_LOG_PATH