forked from ScoDoc/ScoDoc
added cli: flask clear-cache
This commit is contained in:
parent
8c02c6ef7e
commit
243a9b6fd9
15
scodoc.py
15
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.")
|
||||
|
Loading…
Reference in New Issue
Block a user