Commit c66b6847 authored by Zdralovic Edim's avatar Zdralovic Edim

Fixed restart bug, status now updates to 'Running' again

parent 62ff9eda
......@@ -126,7 +126,7 @@ class CWLRestAPI(FlaskView):
@route('/workflows/<workflowID>', methods=['POST'])
def restartWorkflow(self, workflowID):
"""
The status of the workflow matching the given ID (toil Workflow ID) with all job infos is returned in JSON format.
The currently stopped workflow (matching the given ID) will be restarted.
"""
#wf = self.__wfManager.restartWorkflow(workflowID)
return json.dumps(self.__wfManager.restartWorkflow(workflowID))
......@@ -246,7 +246,6 @@ class WorkflowManager:
If the pipeline was stopped by the user and the workflow has been edited, the workflow
has to start from scratch to actually apply these changes.
"""
#TODO: Restarting workflow, thread has to be started again (initializing new object, copying doesn't work)
wfToRestart = None
for i in self.workflowList:
......@@ -256,14 +255,7 @@ class WorkflowManager:
wfToRestart.restart = True
newWorkflow = WorkflowWrapper(restart=True)
print("old")
print(wfToRestart.workDir)
print(wfToRestart.jobStoreForPipeline)
print(wfToRestart.outDir)
print(wfToRestart.toilRunnerArgsList)
print(wfToRestart.toilRunnerArgsListRestart)
#Deep Copy (function copy does not work on threads)
newWorkflow.workflowID = wfToRestart.workflowID
newWorkflow.yamlStream = wfToRestart.yamlStream
newWorkflow.cwlStream = wfToRestart.cwlStream
......@@ -287,13 +279,6 @@ class WorkflowManager:
newWorkflow.toilRunnerArgsList = wfToRestart.toilRunnerArgsList
newWorkflow.toilRunnerArgsListRestart = wfToRestart.toilRunnerArgsListRestart
print("new")
print(newWorkflow.workDir)
print(newWorkflow.jobStoreForPipeline)
print(newWorkflow.outDir)
print(newWorkflow.toilRunnerArgsList)
print(newWorkflow.toilRunnerArgsListRestart)
self.workflowList.remove(wfToRestart)
self.workflowList.append(newWorkflow)
newWorkflow.start()
......@@ -513,7 +498,8 @@ class WorkflowWrapper(threading.Thread):
if not self.restart:
self.toilProcess = subprocess.Popen(self.toilRunnerArgsList, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False)
else:
self.toilProcess = None
self.stopped = False
self.restart = False
self.toilProcess = subprocess.Popen(self.toilRunnerArgsListRestart, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False)
for l in self.toilProcess.stdout:
......
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