diff --git a/modules/hibp/settings.go b/modules/hibp/settings.go index 9f5238f9..a838bd25 100644 --- a/modules/hibp/settings.go +++ b/modules/hibp/settings.go @@ -9,8 +9,8 @@ import ( ) const ( - defaultTitle = "HIBP" - minRefreshSecs = 21600 // TODO: Finish implementing this + defaultTitle = "HIBP" + minRefreshInterval = 21600 // Six hours ) type colors struct { @@ -40,6 +40,12 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co settings.colors.ok = ymlConfig.UString("colors.ok", "green") settings.colors.pwned = ymlConfig.UString("colors.pwned", "red") + // HIBP data doesn't need to be reloaded very often so to be gentle on this API we + // enforce a minimum refresh interval + if settings.common.RefreshInterval < minRefreshInterval { + settings.common.RefreshInterval = minRefreshInterval + } + return &settings }