Skip to content

Commit

Permalink
fix duplicates api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
giannisdoukas committed Jun 5, 2020
1 parent 71c5398 commit e504d44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cwlkernel/git/CWLGitResolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, local_directory: Path, github_url: str):
def resolve(self) -> List[str]:
workflow_files = set()
root_path = self._git_path[:self._git_path.rfind('/')]
search_stack = [self._git_path]
search_stack = {self._git_path}
while len(search_stack) > 0:
current_path = search_stack.pop()
if current_path not in workflow_files:
Expand All @@ -34,7 +34,9 @@ def resolve(self) -> List[str]:
if 'steps' in workflow:
for step in workflow['steps']:
if isinstance(workflow['steps'][step]['run'], str):
search_stack.append('/'.join([root_path, workflow['steps'][step]['run']]))
file = '/'.join([root_path, workflow['steps'][step]['run']])
if file not in workflow_files and file not in search_stack:
search_stack.add(file)
return list(workflow_files)

def _resolve_file(self, path: str) -> Tuple[str, Dict]:
Expand Down

0 comments on commit e504d44

Please sign in to comment.