1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Refresh feeds in the cronjob in parallel

This commit is contained in:
Frédéric Guillot 2023-06-25 10:24:05 -07:00
parent c85b19098d
commit 3dc8e5ebaf
2 changed files with 52 additions and 13 deletions

View file

@ -11,7 +11,6 @@ import (
"miniflux.app/database"
"miniflux.app/locale"
"miniflux.app/logger"
feedHandler "miniflux.app/reader/handler"
"miniflux.app/storage"
"miniflux.app/ui/static"
"miniflux.app/version"
@ -192,18 +191,7 @@ func Parse() {
}
if flagCronjob {
jobs, err := store.NewBatch(config.Opts.BatchSize())
if err != nil {
logger.Error("[Cronjob] %v", err)
}
logger.Info("[Cronjob]] Processing %d jobs", len(jobs))
for _, job := range jobs {
if err := feedHandler.RefreshFeed(store, job.UserID, job.FeedID); err != nil {
logger.Error("[Cronjob] Refreshing the feed #%d returned this error: %v", job.FeedID, err)
}
}
runCronjob(store)
return
}