Commit a1cbb7e2 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Allow cli to force reprocessing of running uploads. #487

parent 32699173
......@@ -91,7 +91,7 @@ def __run_processing(
current_task=upload.current_task, upload_id=upload.upload_id)
return False
else:
upload.reset()
upload.reset(force=True)
process(upload)
upload.block_until_complete(interval=.5)
......
......@@ -212,9 +212,9 @@ class Proc(Document, metaclass=ProcMetaclass):
return self
def reset(self, worker_hostname: str = None):
def reset(self, worker_hostname: str = None, force: bool = False):
''' Resets the task chain. Assumes there no current running process. '''
assert not self.process_running
assert not self.process_running or force
self.current_task = None
self.process_status = None
......
......@@ -1302,9 +1302,9 @@ class Upload(Proc):
# the join was already done due to a prior call
pass
def reset(self):
def reset(self, force=False):
self.joined = False
super().reset()
super().reset(force=force)
@classmethod
def reset_pymongo_update(cls, worker_hostname: str = None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment