From f83a6d819e648ecb1a272b2185ebb852e606d53b Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:20:01 +0200 Subject: [PATCH] Fix job directory not being cleaned up --- lib/galaxy/jobs/__init__.py | 4 +++- lib/galaxy/objectstore/__init__.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index d2afeb82b444..3f8e33321ac2 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -2157,7 +2157,9 @@ def cleanup(self, delete_files: bool = True) -> None: if e.errno != errno.ENOENT: raise if delete_files: - self.object_store.delete(self.get_job(), base_dir="job_work", entire_dir=True, obj_dir=True) + self.object_store.delete( + self.get_job(), base_dir="job_work", entire_dir=True, dir_only=True, obj_dir=True + ) except Exception: log.exception("Unable to cleanup job %d", self.job_id) diff --git a/lib/galaxy/objectstore/__init__.py b/lib/galaxy/objectstore/__init__.py index f38860b7c2c2..b21083381da4 100644 --- a/lib/galaxy/objectstore/__init__.py +++ b/lib/galaxy/objectstore/__init__.py @@ -218,6 +218,7 @@ def delete( obj, entire_dir: bool = False, base_dir=None, + dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None, @@ -572,6 +573,7 @@ def delete( obj, entire_dir: bool = False, base_dir=None, + dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None, @@ -582,6 +584,7 @@ def delete( obj, entire_dir=entire_dir, base_dir=base_dir, + dir_only=dir_only, extra_dir=extra_dir, extra_dir_at_root=extra_dir_at_root, alt_name=alt_name,