From f664a7ab7cceca05557c8e7d4985ac49d4ee338a Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sat, 26 Apr 2014 09:01:41 -0400 Subject: [PATCH] Flush memcache when deploying --- fabfile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fabfile.py b/fabfile.py index bcfa331..7bee315 100644 --- a/fabfile.py +++ b/fabfile.py @@ -201,6 +201,12 @@ def restart_gunicorn(): """ supervisorctl('restart', 'gunicorn') +@task +def flush_memcache(): + """ + Clear everything cached in memcached + """ + virtenv_exec('echo "flush_all" | nc localhost 11211') ####### Update Requirements @task @@ -292,9 +298,11 @@ def first_deploy(): check_secrets() install_reqs() syncdb() + compress_static() collect_static() fetch_usde() import_usde() + flush_memcache() start_supervisord() print "You should run `manage.py createsuperuser` in the virtual environment" @@ -309,5 +317,6 @@ def deploy(): syncdb() compress_static() collect_static() + flush_memcache() restart_supervisord() ########## END COMMANDS -- 2.25.1