From 87648490fda1d765fb7b78544b2b01847550c82b Mon Sep 17 00:00:00 2001 From: Jebbs Date: Thu, 6 Dec 2018 12:35:30 +0800 Subject: Make configurable the number of days to archive read items --- config/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index 7ba3a93..99afaef 100644 --- a/config/config.go +++ b/config/config.go @@ -21,6 +21,7 @@ const ( defaultBatchSize = 10 defaultDatabaseMaxConns = 20 defaultDatabaseMinConns = 1 + defaultArchiveReadDays = 60 defaultListenAddr = "127.0.0.1:8080" defaultCertFile = "" defaultKeyFile = "" @@ -224,6 +225,11 @@ func (c *Config) HasSchedulerService() bool { return !getBooleanValue("DISABLE_SCHEDULER_SERVICE") } +// ArchiveReadDays returns the number of days after which marking read items as removed. +func (c *Config) ArchiveReadDays() int { + return getIntValue("ARCHIVE_READ_DAYS", defaultArchiveReadDays) +} + // NewConfig returns a new Config. func NewConfig() *Config { cfg := &Config{ -- cgit v1.2.3