add a refresh+clear command
This commit is contained in:
parent
625d37209c
commit
ef2f6910e6
|
@ -51,6 +51,7 @@ def create_app(test_config=None):
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
app.cli.add_command(db.clear_queue_command)
|
app.cli.add_command(db.clear_queue_command)
|
||||||
app.cli.add_command(db.refresh_counters_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
|
# scheduler job for giving points to users
|
||||||
def proxy_job():
|
def proxy_job():
|
||||||
|
|
|
@ -106,6 +106,15 @@ def refresh_counters_command():
|
||||||
click.echo('Counters refreshed.')
|
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):
|
def init_app(app):
|
||||||
app.teardown_appcontext(close_db)
|
app.teardown_appcontext(close_db)
|
||||||
app.cli.add_command(init_db_command)
|
app.cli.add_command(init_db_command)
|
||||||
|
|
Loading…
Reference in New Issue