Skip to content

Commit

Permalink
Prevent incomplete files from sticking around in the object store cache.
Browse files Browse the repository at this point in the history
Maybe fixes galaxyproject#18117.
  • Loading branch information
jmchilton committed May 14, 2024
1 parent 4147b38 commit fb21610
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/galaxy/objectstore/_caching_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def _pull_into_cache(self, rel_path) -> bool:
os.makedirs(self._get_cache_path(rel_path_dir), exist_ok=True)
# Now pull in the file
file_ok = self._download(rel_path)
fix_permissions(self.config, self._get_cache_path(rel_path_dir))
if file_ok:
fix_permissions(self.config, self._get_cache_path(rel_path_dir))
else:
unlink(self._get_cache_path(rel_path), ignore_errors=True)
return file_ok

def _get_data(self, obj, start=0, count=-1, **kwargs):
Expand Down

0 comments on commit fb21610

Please sign in to comment.