Start and stop all our processes in one invocation of supervisorctl

With the supervisor speedups, these run much faster.

(imported from commit d8b96178f7c57861e9de8dd640a861c22df6e9ad)
This commit is contained in:
Zev Benjamin 2013-08-21 20:23:23 -04:00
parent 9d895e53d5
commit f7a7527049
1 changed files with 3 additions and 11 deletions

View File

@ -25,19 +25,11 @@ subprocess.check_call(["python", "./manage.py", "send_stats", "incr", "events.se
logging.info("Filling memcached caches") logging.info("Filling memcached caches")
subprocess.check_call(["python", "./manage.py", "fill_memcached_caches"]) subprocess.check_call(["python", "./manage.py", "fill_memcached_caches"])
# Restart the FastCGI and related processes via supervisorctl. We # Restart the FastCGI and related processes via supervisorctl.
# minimize downtime by restarting Django and Tornado separately from
# the other worker processes.
logging.info("Killing daemons") logging.info("Killing daemons")
subprocess.check_call(["supervisorctl", "stop", "humbug-workers:*"]) subprocess.check_call(["supervisorctl", "stop", "humbug-workers:* humbug-django humbug-tornado"])
subprocess.check_call(["supervisorctl", "stop", "humbug-django"])
subprocess.check_call(["supervisorctl", "stop", "humbug-tornado"])
subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "current")]) subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "current")])
subprocess.check_call(["supervisorctl", "start", "humbug-tornado humbug-django humbug-workers:*"])
subprocess.check_call(["supervisorctl", "start", "humbug-tornado"])
subprocess.check_call(["supervisorctl", "start", "humbug-django"])
subprocess.check_call(["supervisorctl", "start", "humbug-workers:*"])
logging.info("Done!") logging.info("Done!")
print OKGREEN + "Application restarted successfully!" + ENDC print OKGREEN + "Application restarted successfully!" + ENDC