From 91fb10e7dc52a8e48953a5477a4854732876c38e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 4 Mar 2013 10:54:21 -0500 Subject: [PATCH] restart-server: Move memcached flush to after server code restart. (imported from commit 12123beac108db54e7e8a0c62b65762920997f7e) --- tools/restart-server | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/restart-server b/tools/restart-server index 808ce7e19a..d6aa2d1649 100755 --- a/tools/restart-server +++ b/tools/restart-server @@ -16,14 +16,6 @@ os.chdir("/home/humbug/humbug") #subprocess.check_call(["python", "manage.py", "syncdb"], stdout=open('/dev/null', 'w')) -try: - if not pylibmc.Client(['127.0.0.1']).flush_all(): - print "%sflush_all returned False%s" % (WARNING, ENDC) - # There doesn't seem to be a method to close a pylibmc Client object. -except: - print "%sCould not flush cache:%s" % (WARNING, ENDC) - traceback.print_exc() - # Delete all .pyc files to avoid old module files hanging around subprocess.check_call(["find", ".", "-name", "*.pyc", "-delete"], stdout=open('/dev/null', 'w')) @@ -38,4 +30,12 @@ for cmd in ('runfcgi', 'runtornado', "process_user_activity"): except subprocess.CalledProcessError: print "%sCould not kill %s; is it running?%s" % (WARNING, cmd, ENDC) +try: + if not pylibmc.Client(['127.0.0.1']).flush_all(): + print "%sflush_all returned False%s" % (WARNING, ENDC) + # There doesn't seem to be a method to close a pylibmc Client object. +except: + print "%sCould not flush cache:%s" % (WARNING, ENDC) + traceback.print_exc() + print OKGREEN + "Application restarted successfully!" + ENDC