1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

refactor: avoid logging twice the feed errors in the background worker

This commit is contained in:
Frédéric Guillot 2025-04-06 15:34:41 -07:00
parent 535fd050b7
commit 0af1a6e121
2 changed files with 6 additions and 9 deletions

View file

@ -244,7 +244,12 @@ func RefreshFeed(store *storage.Storage, userID, feedID int64, forceRefresh bool
}
if localizedError := responseHandler.LocalizedError(); localizedError != nil {
slog.Warn("Unable to fetch feed", slog.String("feed_url", originalFeed.FeedURL), slog.Any("error", localizedError.Error()))
slog.Warn("Unable to fetch feed",
slog.Int64("user_id", userID),
slog.Int64("feed_id", feedID),
slog.String("feed_url", originalFeed.FeedURL),
slog.Any("error", localizedError.Error()),
)
user, storeErr := store.UserByID(userID)
if storeErr != nil {
return locale.NewLocalizedErrorWrapper(storeErr, "error.database_error", storeErr)

View file

@ -44,13 +44,5 @@ func (w *Worker) Run(c <-chan model.Job) {
}
metric.BackgroundFeedRefreshDuration.WithLabelValues(status).Observe(time.Since(startTime).Seconds())
}
if localizedError != nil {
slog.Warn("Unable to refresh a feed",
slog.Int64("user_id", job.UserID),
slog.Int64("feed_id", job.FeedID),
slog.Any("error", localizedError.Error()),
)
}
}
}