diff --git a/exodus_gw/worker/cache.py b/exodus_gw/worker/cache.py index 333a56a6..42d832fa 100644 --- a/exodus_gw/worker/cache.py +++ b/exodus_gw/worker/cache.py @@ -97,7 +97,7 @@ def urls_for_flush(self): return out def do_flush(self, urls: list[str]): - if not self.env.fastpurge_enabled or not urls: + if not self.env.fastpurge_enabled: LOG.info("fastpurge is not enabled for %s", self.env.name) return @@ -120,14 +120,16 @@ def do_flush(self, urls: list[str]): def run(self): urls = self.urls_for_flush - self.do_flush(urls) - LOG.info( - "%s flush of %s URL(s) (%s, ...)", - "Completed" if self.env.fastpurge_enabled else "Skipped", - len(urls), - urls[0] if urls else "", - ) + if urls: + self.do_flush(urls) + + LOG.info( + "%s flush of %s URL(s) (%s, ...)", + "Completed" if self.env.fastpurge_enabled else "Skipped", + len(urls), + urls[0], + ) def load_task(db: Session, task_id: str):