diff --git a/scodoc.py b/scodoc.py index 06c6f3df..8760e93b 100755 --- a/scodoc.py +++ b/scodoc.py @@ -184,3 +184,18 @@ def user_db_import_scodoc7(): # user-db-import-scodoc7 The original SCOUSERS database is left unmodified. """ utils.import_scodoc7_user_db() + + +@app.cli.command() +@with_appcontext +def clear_cache(): # clear-cache + """Clear ScoDoc cache + This cache (currently Redis) is persistent between invocation + and it may be necessary to clear it during developement or tests. + """ + # attaque directement redis, court-circuite ScoDoc: + import redis + + r = redis.Redis() + r.flushall() + click.echo("Redis caches flushed.")