]> git.ipfire.org Git - dbl.git/commitdiff
sources: Force an update of empty sources
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 12:15:09 +0000 (12:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 12:15:09 +0000 (12:15 +0000)
We assume that we could not parse any data and therefore we will just
try again.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index a1035bffda78bf013004d35c3f5d2fadaf5c8cb9..9e2700d820e49883a414dc72aa02f3f12290b725 100644 (file)
@@ -202,6 +202,11 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                # Collect all domains
                domains = set()
 
+               # Force an update if the list has no data
+               if len(self) == 0:
+                       log.debug("Forcing update of %s because it has no data" % self)
+                       force = True
+
                with self.db.transaction():
                        with self.backend.client() as client:
                                # Compose some request headers