mirror of https://github.com/zulip/zulip.git
restart-server: Fill memcached caches after clearing the cache.
Our previous code could in theory end up clearing the caches it had just filled, if Tornado's cache filling work happened to be faster than the memcached flush. (imported from commit 48174aadad398fb7a7c917a1df765c1261b12a55)
This commit is contained in:
parent
adb9c88151
commit
60c3cf826d
|
@ -38,4 +38,7 @@ except:
|
|||
print "%sCould not flush cache:%s" % (WARNING, ENDC)
|
||||
traceback.print_exc()
|
||||
|
||||
subprocess.check_call(["python", os.path.join(os.path.dirname(__file__), "..", "manage.py"),
|
||||
"fill_memcached_caches"])
|
||||
|
||||
print OKGREEN + "Application restarted successfully!" + ENDC
|
||||
|
|
|
@ -113,9 +113,11 @@ def initialize_user_messages():
|
|||
stream = streams[m.recipient.type_id]
|
||||
add_stream_message(stream.realm.id, stream.name, m.id)
|
||||
|
||||
# Filling the memcached cache is a little slow, so do it in a child process.
|
||||
subprocess.Popen(["python", os.path.join(os.path.dirname(__file__), "..", "manage.py"),
|
||||
"fill_message_cache"])
|
||||
if not settings.DEPLOYED:
|
||||
# Filling the memcached cache is a little slow, so do it in a child process.
|
||||
# For DEPLOYED cases, we run this from restart_server.
|
||||
subprocess.Popen(["python", os.path.join(os.path.dirname(__file__), "..", "manage.py"),
|
||||
"fill_memcached_caches"])
|
||||
|
||||
def add_user_message(user_profile_id, message_id):
|
||||
add_table_message("user", user_profile_id, message_id)
|
||||
|
|
Loading…
Reference in New Issue