Skip to content

Commit

Permalink
Enable branch map resetting in workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Oct 14, 2020
1 parent 42fc289 commit b161466
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion law/workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ def run(self):
if self.task.reset_branch_map_before_run and not self._workflow_has_reset_branch_map:
self._workflow_has_reset_branch_map = True

# reset both branch map and cached branch tasks
# reset cached branch map, branch tasks and boundaries
self.task._branch_map = None
self.task._branch_tasks = None
self.task.start_branch = self.task._initial_start_branch
self.task.end_branch = self.task._initial_end_branch


def workflow_property(func):
Expand Down Expand Up @@ -414,6 +416,10 @@ def __init__(self, *args, **kwargs):
# cached attributes for branches
self._workflow_task = None

# store original branch boundaries
self._initial_start_branch = self.start_branch
self._initial_end_branch = self.end_branch

def __getattribute__(self, attr, proxy=True):
return get_proxy_attribute(self, attr, proxy=proxy, super_cls=Task)

Expand Down

0 comments on commit b161466

Please sign in to comment.