From 36560e8aad76a8ea9edc5c10869a2b55a832d62c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 11 Aug 2024 22:35:17 +0300 Subject: fix --- internal/config/config.go | 2 +- internal/config/server/server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 12d40f0..e888e4f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -26,7 +26,7 @@ func FromFile[T any](configFile string) (T, error) { return conf, err } -// Set config from envoronment variable if present, e.g. hansWurst from GOS_HANS_WURST +// Set config from environment variable if present, e.g. hansWurst from GOS_HANS_WURST func EnvToStr(keys ...any) string { for _, key := range keys { switch key := key.(type) { diff --git a/internal/config/server/server.go b/internal/config/server/server.go index a123e81..6008ba9 100644 --- a/internal/config/server/server.go +++ b/internal/config/server/server.go @@ -29,6 +29,7 @@ func New(configFile string) (ServerConfig, error) { conf.DataDir = config.EnvToStr("GOS_DATA_DIR", conf.DataDir, "data") conf.EmailTo = config.EnvToStr("GOS_EMAIL_TO", conf.EmailTo) conf.EmailFrom = config.EnvToStr("GOS_EMAIL_FROM", conf.EmailFrom) + conf.CRONMergeIntervalS = config.EnvToInt("GOS_CRON_MERGE_INTERVAL", conf.CRONMergeIntervalS, 3600) conf.SMTPServer = config.EnvToStr("GOS_SMTP_SERVER", conf.SMTPServer, func() string { hostname, err := os.Hostname() @@ -38,7 +39,6 @@ func New(configFile string) (ServerConfig, error) { return fmt.Sprintf("%s:25", hostname) }) - conf.CRONMergeIntervalS = config.EnvToInt("GOS_CRON_MERGE_INTERVAL", 3600) return conf, nil } -- cgit v1.2.3