diff --git a/server.go b/server.go index 1928297..c22b970 100644 --- a/server.go +++ b/server.go @@ -254,7 +254,7 @@ type Config struct { // Make sure to not put a big number as the batch size to prevent a long-running script. JanitorBatchSize int - // If unset the DefaultMaxArchiveSize is used. If set to a zero or a negative value, nothing will be archived. + // If unset or below 1, the DefaultMaxArchiveSize is used. MaxArchiveSize *int // ArchivedExpirationInDays specifies the number of days after which archived tasks are deleted. @@ -440,6 +440,10 @@ func validateConfig(cfg *Config) { value := base.DefaultMaxArchiveSize cfg.MaxArchiveSize = &value } + if *(cfg.MaxArchiveSize) < 0 { + value := base.DefaultMaxArchiveSize + cfg.MaxArchiveSize = &value + } if cfg.ArchivedExpirationInDays == nil { value := base.DefaultArchivedExpirationInDays cfg.ArchivedExpirationInDays = &value