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

Add scheduler to clean old sessions

This commit is contained in:
Frédéric Guillot 2017-12-16 18:48:17 -08:00
parent 00257988ef
commit 18f55d1569
5 changed files with 60 additions and 17 deletions

View file

@ -47,13 +47,15 @@ func run(cfg *config.Config, store *storage.Storage) {
pool := scheduler.NewWorkerPool(feedHandler, cfg.GetInt("WORKER_POOL_SIZE", config.DefaultWorkerPoolSize))
server := server.NewServer(cfg, store, pool, feedHandler)
scheduler.NewScheduler(
scheduler.NewFeedScheduler(
store,
pool,
cfg.GetInt("POLLING_FREQUENCY", config.DefaultPollingFrequency),
cfg.GetInt("BATCH_SIZE", config.DefaultBatchSize),
)
scheduler.NewSessionScheduler(store, config.DefaultSessionCleanupFrequency)
<-stop
logger.Info("Shutting down the server...")
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)