1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

Avoid excessive manual polling with default scheduler

This commit is contained in:
Frédéric Guillot 2023-10-16 21:20:58 -07:00
parent 54eb500315
commit cc44d14722
7 changed files with 40 additions and 15 deletions

View file

@ -5,6 +5,7 @@ package api // import "miniflux.app/v2/internal/api"
import (
json_parser "encoding/json"
"log/slog"
"net/http"
"time"
@ -141,9 +142,14 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) {
return
}
go func() {
h.pool.Push(jobs)
}()
slog.Info(
"Triggered a manual refresh of all feeds for a given category from the API",
slog.Int64("user_id", userID),
slog.Int64("category_id", categoryID),
slog.Int("nb_jobs", len(jobs)),
)
go h.pool.Push(jobs)
json.NoContent(w, r)
}

View file

@ -5,6 +5,7 @@ package api // import "miniflux.app/v2/internal/api"
import (
json_parser "encoding/json"
"log/slog"
"net/http"
"time"
@ -74,9 +75,13 @@ func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
return
}
go func() {
h.pool.Push(jobs)
}()
slog.Info(
"Triggered a manual refresh of all feeds from the API",
slog.Int64("user_id", userID),
slog.Int("nb_jobs", len(jobs)),
)
go h.pool.Push(jobs)
json.NoContent(w, r)
}