diff options
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/category.go | 10 | ||||
-rw-r--r-- | internal/api/feed.go | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/internal/api/category.go b/internal/api/category.go index 9e13a28f..7b47e2a3 100644 --- a/internal/api/category.go +++ b/internal/api/category.go @@ -9,6 +9,7 @@ import ( "net/http" "time" + "miniflux.app/v2/internal/config" "miniflux.app/v2/internal/http/request" "miniflux.app/v2/internal/http/response/json" "miniflux.app/v2/internal/model" @@ -136,7 +137,14 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) { userID := request.UserID(r) categoryID := request.RouteInt64Param(r, "categoryID") - jobs, err := h.store.NewCategoryBatch(userID, categoryID, h.store.CountFeeds(userID)) + batchBuilder := h.store.NewBatchBuilder() + batchBuilder.WithErrorLimit(config.Opts.PollingParsingErrorLimit()) + batchBuilder.WithoutDisabledFeeds() + batchBuilder.WithUserID(userID) + batchBuilder.WithCategoryID(categoryID) + batchBuilder.WithNextCheckExpired() + + jobs, err := batchBuilder.FetchJobs() if err != nil { json.ServerError(w, r, err) return diff --git a/internal/api/feed.go b/internal/api/feed.go index 0f486f70..27f93ab7 100644 --- a/internal/api/feed.go +++ b/internal/api/feed.go @@ -9,6 +9,7 @@ import ( "net/http" "time" + "miniflux.app/v2/internal/config" "miniflux.app/v2/internal/http/request" "miniflux.app/v2/internal/http/response/json" "miniflux.app/v2/internal/model" @@ -69,7 +70,14 @@ func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) { func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) { userID := request.UserID(r) - jobs, err := h.store.NewUserBatch(userID, h.store.CountFeeds(userID)) + + batchBuilder := h.store.NewBatchBuilder() + batchBuilder.WithErrorLimit(config.Opts.PollingParsingErrorLimit()) + batchBuilder.WithoutDisabledFeeds() + batchBuilder.WithNextCheckExpired() + batchBuilder.WithUserID(userID) + + jobs, err := batchBuilder.FetchJobs() if err != nil { json.ServerError(w, r, err) return |