Skip to content

Commit

Permalink
Merge branch 'clear-cache'
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlecat committed Mar 3, 2015
2 parents e314f6b + 69ec417 commit 84b426d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions critiquebrainz/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ def invalidate_namespace(namespace):
_mc.set(version_key, 1) # initializing the namespace


def flush_all():
if _mc is None: return
_mc.flush_all()


def _get_namespace_version(namespace):
if _mc is None: return
version_key = _glob_namespace + namespace
Expand Down
10 changes: 9 additions & 1 deletion fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from fabric.api import local
from fabric.colors import green, yellow
from critiquebrainz.frontend import create_app
from critiquebrainz import cache
from manage import init_postgres


Expand Down Expand Up @@ -49,10 +50,17 @@ def compile_styling():
print(green("Style sheets have been compiled successfully.", bold=True))


def clear_memcached():
with create_app().app_context():
cache.flush_all()
print(green("Flushed everything from memcached.", bold=True))


def deploy():
"""Compile translations and styling."""
"""Compile translations and styling, clear memcached."""
compile_translations()
compile_styling()
clear_memcached()


def test(init_db=True, coverage=True):
Expand Down

0 comments on commit 84b426d

Please sign in to comment.