|
|
@@ -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.
|