add a refresh+clear command

This commit is contained in:
Lili (Tlapka) 2023-01-13 11:04:01 +01:00
parent 625d37209c
commit ef2f6910e6
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,7 @@ def create_app(test_config=None):
db.init_app(app)
app.cli.add_command(db.clear_queue_command)
app.cli.add_command(db.refresh_counters_command)
app.cli.add_command(db.refresh_and_clear_command)
# scheduler job for giving points to users
def proxy_job():

View File

@ -106,6 +106,15 @@ def refresh_counters_command():
click.echo('Counters refreshed.')
@click.command('clear-refresh')
@with_appcontext
def refresh_and_clear_command():
"""Refresh counters and clear queue."""
refresh_counters()
clear_redeem_queue()
click.echo('Counters refreshed and queue cleared.')
def init_app(app):
app.teardown_appcontext(close_db)
app.cli.add_command(init_db_command)