mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Don't compute reading-time when unused
If the user doesn't display reading times, there is no need to compute them. This should speed things up a bit, since `whatlanggo.Detect` is abysmally slow.
This commit is contained in:
parent
97765b93a9
commit
31ac62f410
2 changed files with 9 additions and 3 deletions
|
@ -275,7 +275,9 @@ func (h *handler) updateEntry(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
entryUpdateRequest.Patch(entry)
|
||||
entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed)
|
||||
if user.ShowReadingTime {
|
||||
entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed)
|
||||
}
|
||||
|
||||
if err := h.store.UpdateEntryTitleAndContent(entry); err != nil {
|
||||
json.ServerError(w, r, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue