diff options
author | 2023-08-24 12:02:46 +0200 | |
---|---|---|
committer | 2023-08-31 20:27:09 -0700 | |
commit | bea9017b4833ee8608657feb31d650fe48183c8d (patch) | |
tree | 88ac5340ed864150b63a2082fad03c034f9e2d1d /internal/config/options.go | |
parent | 64c4c6b34743761d0f6ea02fc4d37594781afbf4 (diff) | |
download | v2-bea9017b4833ee8608657feb31d650fe48183c8d.tar.gz v2-bea9017b4833ee8608657feb31d650fe48183c8d.tar.zst v2-bea9017b4833ee8608657feb31d650fe48183c8d.zip |
Add factor for entry_frequency scheduler
Allow the user to increase the frequency of the entry_frequency
scheduler by a configurable factor in order to shorten the time between
updates.
Diffstat (limited to 'internal/config/options.go')
-rw-r--r-- | internal/config/options.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/config/options.go b/internal/config/options.go index 5ca6306c..d4a56d4b 100644 --- a/internal/config/options.go +++ b/internal/config/options.go @@ -30,6 +30,7 @@ const ( defaultPollingScheduler = "round_robin" defaultSchedulerEntryFrequencyMinInterval = 5 defaultSchedulerEntryFrequencyMaxInterval = 24 * 60 + defaultSchedulerEntryFrequencyFactor = 1 defaultPollingParsingErrorLimit = 3 defaultRunMigrations = false defaultDatabaseURL = "user=postgres password=postgres dbname=miniflux2 sslmode=disable" @@ -118,6 +119,7 @@ type Options struct { pollingScheduler string schedulerEntryFrequencyMinInterval int schedulerEntryFrequencyMaxInterval int + schedulerEntryFrequencyFactor int pollingParsingErrorLimit int workerPoolSize int createAdmin bool @@ -191,6 +193,7 @@ func NewOptions() *Options { pollingScheduler: defaultPollingScheduler, schedulerEntryFrequencyMinInterval: defaultSchedulerEntryFrequencyMinInterval, schedulerEntryFrequencyMaxInterval: defaultSchedulerEntryFrequencyMaxInterval, + schedulerEntryFrequencyFactor: defaultSchedulerEntryFrequencyFactor, pollingParsingErrorLimit: defaultPollingParsingErrorLimit, workerPoolSize: defaultWorkerPoolSize, createAdmin: defaultCreateAdmin, @@ -368,6 +371,11 @@ func (o *Options) SchedulerEntryFrequencyMinInterval() int { return o.schedulerEntryFrequencyMinInterval } +// SchedulerEntryFrequencyFactor returns the factor for the entry frequency scheduler. +func (o *Options) SchedulerEntryFrequencyFactor() int { + return o.schedulerEntryFrequencyFactor +} + // PollingParsingErrorLimit returns the limit of errors when to stop polling. func (o *Options) PollingParsingErrorLimit() int { return o.pollingParsingErrorLimit @@ -628,6 +636,7 @@ func (o *Options) SortedOptions(redactSecret bool) []*Option { "RUN_MIGRATIONS": o.runMigrations, "SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL": o.schedulerEntryFrequencyMaxInterval, "SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL": o.schedulerEntryFrequencyMinInterval, + "SCHEDULER_ENTRY_FREQUENCY_FACTOR": o.schedulerEntryFrequencyFactor, "SCHEDULER_SERVICE": o.schedulerService, "SERVER_TIMING_HEADER": o.serverTimingHeader, "WATCHDOG": o.watchdog, |