Revert "only write feedfetcherror if changed" This reverts commit ccc2f91587c85d84e2bbfec85a7e40040dc8427f.
Jes Olson j3s@c3f.net
Mon, 20 Mar 2023 19:42:55 -0700
2 files changed,
1 insertions(+),
18 deletions(-)
M
reaper/reaper.go
→
reaper/reaper.go
@@ -85,16 +85,8 @@
// updateFeed triggers a fetch on the given feed, // and sets a fetch error in the db if there is one. func (r *Reaper) updateFeed(f *rss.Feed) { - var currentErr string err := f.Update() - if err != nil { - currentErr = err.Error() - } - - storedErr := r.db.GetFeedFetchError(f.UpdateURL) - if currentErr != storedErr { - r.db.SetFeedFetchError(f.UpdateURL, err) - } + r.db.SetFeedFetchError(f.UpdateURL, err) } // Have checks whether a given url is represented
M
sqlite/sql.go
→
sqlite/sql.go
@@ -219,12 +219,3 @@ if err != nil {
panic(err) } } - -func (s *DB) GetFeedFetchError(url string) string { - var fetchErr string - err := s.sql.QueryRow(`SELECT fetch_error FROM feed WHERE url=?`, url).Scan(&fetchErr) - if err != nil { - panic(err) - } - return fetchErr -}