mirror of https://github.com/zulip/zulip.git
Add an IS_WORKER setting that is True when the current process is a worker
(imported from commit f8976b8345e9c709c2336a17d18260130f3f2562)
This commit is contained in:
parent
db23674749
commit
ced2f86fd7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue