Skip to content

Commit

Permalink
Merge remote-tracking branch 'vvk/tip-cli-drop-worker-data' into pr-7…
Browse files Browse the repository at this point in the history
…29-merge
  • Loading branch information
joelvai committed Mar 20, 2020
2 parents 3ff6303 + e2429f2 commit 4d62f0c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dexbot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os.path
import signal
import sys
import time
from multiprocessing import freeze_support

import bitshares.exceptions
Expand All @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 4d62f0c

Please sign in to comment.