diff options
author | Ty Cobb <ty.cobb.m@gmail.com> | 2019-09-11 22:10:34 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2019-09-11 20:10:33 -0700 |
commit | 3a60abbac07bd342f261fccb46bfd5b0039b3f74 (patch) | |
tree | 2c1608b4918f83493f9a8e1a8482ce21d793690d /config/options.go | |
parent | 8d8f78241d303381abf6879cc007ca9cbc2a12e2 (diff) |
Make configurable the number of days to remove old sessions
Diffstat (limited to 'config/options.go')
-rw-r--r-- | config/options.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/config/options.go b/config/options.go index e23a4ae..a5c75b8 100644 --- a/config/options.go +++ b/config/options.go @@ -27,6 +27,7 @@ const ( defaultDatabaseMaxConns = 20 defaultDatabaseMinConns = 1 defaultArchiveReadDays = 60 + defaultRemoveSessionsDays = 30 defaultListenAddr = "127.0.0.1:8080" defaultCertFile = "" defaultKeyFile = "" @@ -67,6 +68,7 @@ type Options struct { certKeyFile string cleanupFrequency int archiveReadDays int + removeSessionsDays int pollingFrequency int batchSize int workerPoolSize int @@ -105,6 +107,7 @@ func NewOptions() *Options { certKeyFile: defaultKeyFile, cleanupFrequency: defaultCleanupFrequency, archiveReadDays: defaultArchiveReadDays, + removeSessionsDays: defaultRemoveSessionsDays, pollingFrequency: defaultPollingFrequency, batchSize: defaultBatchSize, workerPoolSize: defaultWorkerPoolSize, @@ -271,6 +274,11 @@ func (o *Options) ArchiveReadDays() int { return o.archiveReadDays } +// RemoveSessionsDays returns the number of days after which to remove sessions. +func (o *Options) RemoveSessionsDays() int { + return o.removeSessionsDays +} + // PocketConsumerKey returns the Pocket Consumer Key if configured. func (o *Options) PocketConsumerKey(defaultValue string) string { if o.pocketConsumerKey != "" { |