From 1665be20d38e5031e3c20b1a2072da5e21805689 Mon Sep 17 00:00:00 2001 From: nille02 Date: Wed, 11 Dec 2024 07:43:03 +0100 Subject: [PATCH] Revert the quere to the older one again Without the check for the tries a prior failed job, without any history is skipped --- lib/urlwatch/storage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/urlwatch/storage.py b/lib/urlwatch/storage.py index 9a405a99..c111dc50 100644 --- a/lib/urlwatch/storage.py +++ b/lib/urlwatch/storage.py @@ -605,7 +605,9 @@ def get_history_data(self, guid, count=1): def has_history_data(self, guid): if not self._cached_has_history_data_set: self._cached_has_history_data_set = frozenset(guid[0] for guid in - list(CacheEntry.query(self.db, CacheEntry.c.guid.distinct("guid")))) # noqa:E711 + list(CacheEntry.query(self.db,CacheEntry.c.guid, + where=((CacheEntry.c.tries == 0) | + (CacheEntry.c.tries == None))))) # noqa:E711 return guid in self._cached_has_history_data_set def save(self, job, guid, data, timestamp, tries, etag=None):