From 3097092ae53db58bf5123881f084a6c95b3e0c27 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 17 Feb 2019 15:02:10 +1100 Subject: [PATCH] Add run task CLI option --- eosweb/core/main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eosweb/core/main.py b/eosweb/core/main.py index d8f4f99..08716cd 100644 --- a/eosweb/core/main.py +++ b/eosweb/core/main.py @@ -196,6 +196,20 @@ def tally_stv_election(electionid, qnum, randfile, numseats): task.save() task.run() +@app.cli.command('run_task') +@click.option('--electionid', default=None) +@click.option('--task_name', default=None) +def tally_stv_election(electionid, task_name): + election = Election.get_by_id(electionid) + task = WorkflowTaskEntryWebTask( + election_id=election._id, + workflow_task=task_name, + status=TaskStatus.READY, + run_strategy=EosObject.lookup(app.config['TASK_RUN_STRATEGY'])() + ) + task.save() + task.run() + @app.context_processor def inject_globals(): return {'eos': eos, 'eosweb': eosweb, 'SHA256': eos.core.hashing.SHA256}