mirror of
https://github.com/nkanaev/yarr.git
synced 2026-06-09 18:03:19 +00:00
feedstate fixes
This commit is contained in:
@@ -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)
|
||||
`,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user