]> git.ipfire.org Git - dbl.git/commitdiff
sources: Catch any connect timeouts
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2026 10:59:07 +0000 (10:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2026 10:59:07 +0000 (10:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/sources.py

index 94be2d0aeab923b163380e91787e3b0d600ce3a0..bd4ae37162e675e2b14bf740529750bd87dafac0 100644 (file)
@@ -313,6 +313,12 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                                        # The list has now been updated
                                        self.updated_at = sqlmodel.func.current_timestamp()
 
+                               # Catch any timeouts
+                               except httpx.ConnectTimeout as e:
+                                       log.warning("Failed to connect to %s: %s" % (self.url, e))
+
+                                       return False
+
                                # Skip if we could not read from the server
                                except httpx.ReadTimeout as e:
                                        log.warning("Failed to read the server's response: %s" % e)