Skip to content

Commit

Permalink
add before/after task to ParallelTask only when not command list is n…
Browse files Browse the repository at this point in the history
…ot empty (#93)
  • Loading branch information
leo-schick authored Feb 16, 2023
1 parent 405352f commit a53904f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mara_pipelines/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ def add_parallel_tasks(self, sub_pipeline: 'Pipeline') -> None:
def launch(self) -> 'Pipeline':
sub_pipeline = Pipeline(self.id, description=f'Runs f{self.id} in parallel',
max_number_of_parallel_tasks=self.max_number_of_parallel_tasks)
sub_pipeline.add_initial(Task(id='before', description='Runs commands-before', commands=self.commands_before))
sub_pipeline.add_final(Task(id='after', description='Runs commands-after', commands=self.commands_after))
if self.commands_before:
sub_pipeline.add_initial(Task(id='before', description='Runs commands-before', commands=self.commands_before))
if self.commands_after:
sub_pipeline.add_final(Task(id='after', description='Runs commands-after', commands=self.commands_after))

self.add_parallel_tasks(sub_pipeline)

Expand Down

0 comments on commit a53904f

Please # to comment.