Restart Tornado _after_ moving the deployment symlink.

Otherwise we end up running Tornado against the _previous_ version of
our code!

Testing of using supervisorctl to stop and then start a process shows
it takes about the same amount of time as doing a supervisorctl
restart, so there's no reason not to split the two commands apart and
make it super clear that nothing is running at the time that we move
the deployment symlink.

(imported from commit c38049da2bfc9fa94320a32dbf3240d1fcba67f7)
This commit is contained in:
Tim Abbott 2013-06-13 16:22:22 -04:00
parent deb89a9c9e
commit cbbca8319b
1 changed files with 2 additions and 1 deletions

View File

@ -26,10 +26,11 @@ subprocess.check_call(["python", "./manage.py", "fill_memcached_caches"])
logging.info("Killing daemons")
subprocess.check_call(["supervisorctl", "stop", "humbug-workers:*"])
subprocess.check_call(["supervisorctl", "stop", "humbug-django"])
subprocess.check_call(["supervisorctl", "restart", "humbug-tornado"])
subprocess.check_call(["supervisorctl", "stop", "humbug-tornado"])
subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "current")])
subprocess.check_call(["supervisorctl", "start", "humbug-tornado"])
subprocess.check_call(["supervisorctl", "start", "humbug-django"])
subprocess.check_call(["supervisorctl", "start", "humbug-workers:*"])