Merge pull request #100 from gazpachoking/clear_cache_command

Add clear_cache cli command. fix #98
Este commit está contenido en:
Matthew Scragg 2015-12-21 20:55:39 -05:00
commit 91a8ac9189
Se han modificado 1 ficheros con 10 adiciones y 1 borrados

Ver fichero

@ -1,4 +1,4 @@
from realms import config, create_app, db, __version__, flask_cli as cli
from realms import config, create_app, db, __version__, flask_cli as cli, cache
from realms.lib.util import random_string, in_virtualenv, green, yellow, red
from subprocess import call, Popen
from multiprocessing import cpu_count
@ -407,6 +407,15 @@ def drop_db():
db.metadata.drop_all(db.get_engine(app))
@cli.command()
def clear_cache():
""" Clears cache
"""
yellow("Clearing the cache")
with app.app_context():
cache.clear()
@cli.command()
def test():
""" Run tests