Skip to content

Commit

Permalink
Skip file transfer when the source file is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Jul 16, 2023
1 parent 31d8a99 commit f549bf9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pulsar/client/action_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ def __init__(self, source, file_lister=None):
def path(self):
return self.source.get("path")

def path_exists(self):
return exists(self.path)

def unstructured_map(self, path_helper):
unstructured_map = self.file_lister.unstructured_map(self.path)
if self.staging_needed:
Expand Down
10 changes: 9 additions & 1 deletion pulsar/managers/staging/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ def collect_output(self, results_collector, output_type, action, name):

pulsar_path = self.job_directory.calculate_path(name, output_type)
description = "staging out file {} via {}".format(pulsar_path, action)
self.action_executor.execute(lambda: action.write_from_path(pulsar_path), description)

if not action.path_exists():
log.warn(
f"Output not collectable. File does not exist: {pulsar_path}")
else:
self.action_executor.execute(
lambda: action.write_from_path(pulsar_path),
description,
)


def __pulsar_outputs(job_directory):
Expand Down

0 comments on commit f549bf9

Please sign in to comment.