mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
perf(storage): minor optimization for FetchJobs
- Replace a call to fmt.Sprintf with a concatenation - Explicit declaration of return values in FetchJobs - Initialize the size of FetchJobs return value to b.limit: when b.limit is used, which is most of the time, this avoid resizing the slice, and when it isn't, the size of the map is set to 0, which is equivalent to the previous situation anyway. - Move a call to `request.UserID(r)` to a lower scope.
This commit is contained in:
parent
76ef8f3579
commit
a6ce5c92dc
2 changed files with 6 additions and 4 deletions
|
@ -33,7 +33,6 @@ func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
|
||||
userID := request.UserID(r)
|
||||
printer := locale.NewPrinter(request.UserLanguage(r))
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
|
||||
|
@ -42,6 +41,7 @@ func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
|
|||
time := config.Opts.ForceRefreshInterval()
|
||||
sess.NewFlashErrorMessage(printer.Plural("alert.too_many_feeds_refresh", time, time))
|
||||
} else {
|
||||
userID := request.UserID(r)
|
||||
// We allow the end-user to force refresh all its feeds
|
||||
// without taking into consideration the number of errors.
|
||||
batchBuilder := h.store.NewBatchBuilder()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue