Fix race condition

This commit is contained in:
Patrick Jentsch 2021-03-26 14:48:38 +01:00
parent 54f336e620
commit 72409bd12d

4
nlp
View File

@ -89,6 +89,7 @@ class NLPPipeline(WorkflowRunner):
' # vrt creation # ' # vrt creation #
' ################################################## ' ##################################################
''' '''
vrt_creation_tasks = []
for i, job in enumerate(self.jobs): for i, job in enumerate(self.jobs):
output_file = os.path.join(job.output_dir, '{}.vrt'.format(job.name)) # noqa output_file = os.path.join(job.output_dir, '{}.vrt'.format(job.name)) # noqa
nlp_file = os.path.join(job.output_dir, '{}.nopaque-stand-off.json'.format(job.name)) # noqa nlp_file = os.path.join(job.output_dir, '{}.nopaque-stand-off.json'.format(job.name)) # noqa
@ -99,6 +100,7 @@ class NLPPipeline(WorkflowRunner):
deps = 'nlp_-_{}'.format(i) deps = 'nlp_-_{}'.format(i)
lbl = 'vrt_creation_-_{}'.format(i) lbl = 'vrt_creation_-_{}'.format(i)
task = self.addTask(command=cmd, dependencies=deps, label=lbl) task = self.addTask(command=cmd, dependencies=deps, label=lbl)
vrt_creation_tasks.append(task)
''' '''
' ################################################## ' ##################################################
@ -116,7 +118,7 @@ class NLPPipeline(WorkflowRunner):
cmd += ' -i "*.vrt" "*.json"' cmd += ' -i "*.vrt" "*.json"'
cmd += ' && ' cmd += ' && '
cmd += 'cd -' cmd += 'cd -'
deps = nlp_tasks deps = vrt_creation_tasks
lbl = 'zip_creation' lbl = 'zip_creation'
task = self.addTask(command=cmd, dependencies=deps, label=lbl) task = self.addTask(command=cmd, dependencies=deps, label=lbl)
zip_creation_tasks.append(task) zip_creation_tasks.append(task)