mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add refreshAllFeeds to the API
Adds refreshAllFeeds to the API, following the suggestion given in the comments of #359.
This commit is contained in:
parent
7389c79c52
commit
7b32f59281
4 changed files with 22 additions and 3 deletions
15
api/feed.go
15
api/feed.go
|
@ -82,6 +82,21 @@ func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) {
|
|||
json.NoContent(w, r)
|
||||
}
|
||||
|
||||
func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
|
||||
userID := request.UserID(r)
|
||||
jobs, err := h.store.NewUserBatch(userID, h.store.CountFeeds(userID))
|
||||
if err != nil {
|
||||
json.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
h.pool.Push(jobs)
|
||||
}()
|
||||
|
||||
json.NoContent(w, r)
|
||||
}
|
||||
|
||||
func (h *handler) updateFeed(w http.ResponseWriter, r *http.Request) {
|
||||
feedID := request.RouteInt64Param(r, "feedID")
|
||||
feedChanges, err := decodeFeedModificationPayload(r.Body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue