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):