From 98c3839168fc10f29b7bc6ed29d968cbc4efb6f5 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Sun, 20 Dec 2015 13:38:19 -0500 Subject: [PATCH] Add clear_cache cli command. fix #98 --- realms/commands.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/realms/commands.py b/realms/commands.py index c72cbeb..326d67d 100644 --- a/realms/commands.py +++ b/realms/commands.py @@ -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