Skip to content

Commit

Permalink
Fixup to 'Move existing cleanups'
Browse files Browse the repository at this point in the history
  • Loading branch information
kfindeisen committed Aug 30, 2024
1 parent 3146486 commit e7551c4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions python/activator/middleware_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,14 +1678,15 @@ def clean_local_repo(self, exposure_ids: set[int]) -> None:
"""
with lsst.utils.timer.time_this(_log, msg="clean_local_repo", level=logging.DEBUG):
self.butler.registry.refresh()
raws = self.butler.registry.queryDatasets(
'raw',
collections=self.instrument.makeDefaultRawIngestRunName(),
where=f"exposure in ({', '.join(str(x) for x in exposure_ids)})",
instrument=self.visit.instrument,
detector=self.visit.detector,
)
self.butler.pruneDatasets(raws, disassociate=True, unstore=True, purge=True)
if exposure_ids:
raws = self.butler.registry.queryDatasets(
'raw',
collections=self.instrument.makeDefaultRawIngestRunName(),
where=f"exposure in ({', '.join(str(x) for x in exposure_ids)})",
instrument=self.visit.instrument,
detector=self.visit.detector,
)
self.butler.pruneDatasets(raws, disassociate=True, unstore=True, purge=True)
# Outputs are all in their own runs, so just drop them.
preload_run = self._get_preload_run(self._day_obs)
_remove_run_completely(self.butler, preload_run)
Expand Down

0 comments on commit e7551c4

Please sign in to comment.