mirror of
https://github.com/miniflux/v2.git
synced 2025-08-31 18:31:01 +00:00
refactor(ui): standardize user variable naming and avoid a SQL query when only userID
is used
- Use `user` everywhere, instead of sometimes `loggedUser` - Delay the instantiation of some variables: no need to perform SQL queries for nothing. - Remove a SQL query getting the whole user struct when only user.ID is used.
This commit is contained in:
parent
50c5996280
commit
5d9d0b2652
11 changed files with 50 additions and 57 deletions
|
@ -27,7 +27,6 @@ func (h *handler) refreshCategoryFeedsPage(w http.ResponseWriter, r *http.Reques
|
|||
}
|
||||
|
||||
func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) int64 {
|
||||
userID := request.UserID(r)
|
||||
categoryID := request.RouteInt64Param(r, "categoryID")
|
||||
printer := locale.NewPrinter(request.UserLanguage(r))
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
|
@ -37,6 +36,7 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) int64
|
|||
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 in this category
|
||||
// without taking into consideration the number of errors.
|
||||
batchBuilder := h.store.NewBatchBuilder()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue