mirror of https://github.com/zulip/zulip.git
tools/run-dev.py: Clear memcached.
Clear memcached when tools/run-dev.py is run. This prevents errors on using a different python version because values are pickled before being stored in memcached and different python versions implement pickling differently. Also provide a command-line option --no-clear-mc to prevent memcached from being cleared.
This commit is contained in:
parent
014a13df7c
commit
38b1353f42
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import optparse
|
||||
import subprocess
|
||||
import signal
|
||||
|
@ -43,6 +45,10 @@ parser.add_option('--interface',
|
|||
action='store', dest='interface',
|
||||
default='127.0.0.1', help='Set the IP or hostname for the proxy to listen on')
|
||||
|
||||
parser.add_option('--no-clear-memcached',
|
||||
action='store_false', dest='clear_memcached',
|
||||
default=True, help='Do not clear memcached')
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
base_port = 9991
|
||||
|
@ -67,6 +73,10 @@ os.chdir(os.path.join(os.path.dirname(__file__), '..'))
|
|||
# Clean up stale .pyc files etc.
|
||||
subprocess.check_call('./tools/clean-repo')
|
||||
|
||||
if options.clear_memcached:
|
||||
print("Clearing memcached ...")
|
||||
subprocess.check_call('./scripts/setup/flush-memcached')
|
||||
|
||||
# Set up a new process group, so that we can later kill run{server,tornado}
|
||||
# and all of the processes they spawn.
|
||||
os.setpgrp()
|
||||
|
|
Loading…
Reference in New Issue