diff options
author | 2024-04-19 15:31:49 +0200 | |
---|---|---|
committer | 2024-04-19 11:58:13 -0700 | |
commit | 2caabbe93986ee05024f4c313786d46f5f5e589b (patch) | |
tree | e3508751836d054ea2f3fd8d03c94fce2c02f0a8 | |
parent | 771f9d2b5fe40a034d206e166db0f040ac24fb22 (diff) | |
download | v2-2caabbe93986ee05024f4c313786d46f5f5e589b.tar.gz v2-2caabbe93986ee05024f4c313786d46f5f5e589b.tar.zst v2-2caabbe93986ee05024f4c313786d46f5f5e589b.zip |
fix: Use `FORCE_REFRESH_INTERVAL` config for category refresh
Diffstat (limited to '')
-rw-r--r-- | internal/ui/category_refresh.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/ui/category_refresh.go b/internal/ui/category_refresh.go index e3eed10e..c0ca39b8 100644 --- a/internal/ui/category_refresh.go +++ b/internal/ui/category_refresh.go @@ -8,6 +8,7 @@ import ( "net/http" "time" + "miniflux.app/v2/internal/config" "miniflux.app/v2/internal/http/request" "miniflux.app/v2/internal/http/response/html" "miniflux.app/v2/internal/http/route" @@ -32,8 +33,9 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) int64 sess := session.New(h.store, request.SessionID(r)) // Avoid accidental and excessive refreshes. - if time.Now().UTC().Unix()-request.LastForceRefresh(r) < 1800 { - sess.NewFlashErrorMessage(printer.Print("alert.too_many_feeds_refresh")) + if time.Now().UTC().Unix()-request.LastForceRefresh(r) < int64(config.Opts.ForceRefreshInterval())*60 { + time := config.Opts.ForceRefreshInterval() + sess.NewFlashErrorMessage(printer.Plural("alert.too_many_feeds_refresh", time, time)) } else { // We allow the end-user to force refresh all its feeds in this category // without taking into consideration the number of errors. |