diff --git a/src/storage/feedstate.go b/src/storage/feedstate.go index 5caa36b..6cc6fa9 100644 --- a/src/storage/feedstate.go +++ b/src/storage/feedstate.go @@ -102,7 +102,7 @@ func (s *Storage) UpdateFeedState(feedID int64, params UpdateFeedStateParams) (b ) on conflict (feed_id) do update set last_refreshed = coalesce(:last_refreshed, last_refreshed), - last_error = coalesce(:last_error, last_modified), + last_error = coalesce(:last_error, last_error), http_lmod = coalesce(:http_lmod, http_lmod), http_etag = coalesce(:http_etag, http_etag) `, diff --git a/src/storage/migration.go b/src/storage/migration.go index e3e3910..714f464 100644 --- a/src/storage/migration.go +++ b/src/storage/migration.go @@ -366,11 +366,11 @@ func m13_consolidate_feed_states(tx *sql.Tx) error { , http_etag ) select - f.id, - coalesce(h.last_refreshed, 0), - coalesce(e.error, '') - coalesce(h.last_modified, ''), - coalesce(h.etag, ''), + f.id + , coalesce(h.last_refreshed, 0) + , coalesce(e.error, '') + , coalesce(h.last_modified, '') + , coalesce(h.etag, '') from feeds f left join http_states h on f.id = h.feed_id left join feed_errors e on f.id = e.feed_id diff --git a/src/storage/storage_test.go b/src/storage/storage_test.go index 09908c1..1270344 100644 --- a/src/storage/storage_test.go +++ b/src/storage/storage_test.go @@ -9,9 +9,11 @@ import ( func testDB() *Storage { log.SetOutput(io.Discard) - db, _ := New(":memory:") + db, err := New(":memory:") + if err != nil { + panic(err) + } log.SetOutput(os.Stderr) - log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) return db }