Revise comments.

This commit is contained in:
Brent Simmons committed 2026-05-29 13:09:38 -07:00
1 parent e4deea8781
commit 7b6e5fcbd6
3 files changed
+13 -41

No files matched your search

@@ -55,11 +55,7 @@ struct HTMLMetadataTable {
return (record, lastChecked, statusCode)
}
/// Records a failure outcome for a URL: inserts a failure marker, or updates
/// an existing failure row's status and date. The `WHERE` guard preserves
/// rows that hold a successful (2xx) fetch — a transient failure never
/// erases good cached metadata. Accepts both 4xx (persistent) and 0
/// (transient pre-response failure).
/// The WHERE guard preserves rows with a 2xx success.
static func noteFailure(url: String, statusCode: Int, database: FMDatabase) {
let sql = "INSERT INTO \(name) (\(Column.url), \(Column.lastChecked), \(Column.statusCode)) VALUES (?, ?, ?) ON CONFLICT(\(Column.url)) DO UPDATE SET \(Column.lastChecked) = excluded.\(Column.lastChecked), \(Column.statusCode) = excluded.\(Column.statusCode) WHERE \(Column.statusCode) >= 400 OR \(Column.statusCode) = 0;"
database.executeUpdate(sql, withArgumentsIn: [url, Date().timeIntervalSince1970, statusCode])