refactor feedstate + swap implementation

This commit is contained in:
nkanaev
2026-05-18 20:06:41 +01:00
parent 7553824520
commit 85f3956b24
9 changed files with 101 additions and 167 deletions

View File

@@ -162,7 +162,15 @@ func (s *Server) handleFeedRefresh(c *router.Context) {
}
func (s *Server) handleFeedErrors(c *router.Context) {
errors := s.db.GetFeedErrors()
errors := make(map[int64]string)
states, err := s.db.ListFeedStates()
if err == nil {
for _, state := range states {
if state.LastError != "" {
errors[state.FeedID] = state.LastError
}
}
}
c.JSON(http.StatusOK, errors)
}