diff --git a/ch_pipeline/processing/base.py b/ch_pipeline/processing/base.py index 967ca60c..c189b8ff 100644 --- a/ch_pipeline/processing/base.py +++ b/ch_pipeline/processing/base.py @@ -339,9 +339,10 @@ def pending(self): """Jobs available to run.""" waiting, running = self.queued() - pending = set(self.available()).difference(self.ls(), waiting, running) + not_pending = set(self.ls()) | set(waiting) | set(running) + pending = [job for job in self.available() if job not in not_pending] - return sorted(list(pending)) + return pending def find_venv(): diff --git a/ch_pipeline/processing/daily.py b/ch_pipeline/processing/daily.py index 2dd33390..be7df61b 100644 --- a/ch_pipeline/processing/daily.py +++ b/ch_pipeline/processing/daily.py @@ -223,8 +223,12 @@ def _available_tags(self): # - Figure out which sidereal days are covered by this range csds = [] + + # For each interval find and add all CSDs that have not already been added for interval in self._intervals: - csds += csds_in_range(*interval) + csd_i = csds_in_range(*interval) + csd_set = set(csds) + csds += [csd for csd in csd_i if csd not in csd_set] tags = ["%i" % csd for csd in csds]