diff --git a/dexbot/cli.py b/dexbot/cli.py index 2b3130d27..e70b43c69 100755 --- a/dexbot/cli.py +++ b/dexbot/cli.py @@ -4,6 +4,7 @@ import os.path import signal import sys +import time from multiprocessing import freeze_support import bitshares.exceptions @@ -13,6 +14,7 @@ from dexbot.cli_conf import SYSTEMD_SERVICE_NAME, get_whiptail, setup_systemd from dexbot.config import DEFAULT_CONFIG_FILE, Config from dexbot.helper import initialize_data_folders, initialize_orders_log +from dexbot.storage import Storage from dexbot.ui import chain, configfile, reset_nodes, unlock, verbose from uptick.decorators import online @@ -186,6 +188,15 @@ def cancel(ctx, market, account): log.info(f"Account does not exist: {account}") +@click.argument('worker_name') +def drop_state(worker_name): + """ Drop state of the worker (sqlite data) + """ + click.echo('Dropping state for {}'.format(worker_name)) + Storage.clear_worker_data(worker_name) + time.sleep(1) + + def worker_job(worker, job): return lambda x, y: worker.do_next_tick(job)