aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-19 04:17:50 -0800
committerFuwn <[email protected]>2026-01-19 04:17:50 -0800
commit1e96ec397d38e6263c5369d91f2579092c9c9390 (patch)
treeb4b73accb870de9178acc931443c8cd474423fa5 /internal/config/config.go
parentfeat: Add browser timezone option for client-side time display (diff)
downloadkaze-1e96ec397d38e6263c5369d91f2579092c9c9390.tar.xz
kaze-1e96ec397d38e6263c5369d91f2579092c9c9390.zip
feat: Add retry option for monitor checks
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index d4e096f..f7f1ad6 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -68,6 +68,7 @@ type MonitorConfig struct {
Target string `yaml:"target"`
Interval Duration `yaml:"interval"`
Timeout Duration `yaml:"timeout"`
+ Retries int `yaml:"retries,omitempty"` // Number of retry attempts before marking as down
ExpectedStatus int `yaml:"expected_status,omitempty"`
VerifySSL *bool `yaml:"verify_ssl,omitempty"`
Method string `yaml:"method,omitempty"`
@@ -198,6 +199,10 @@ func (c *Config) applyDefaults() {
if m.Timeout.Duration == 0 {
m.Timeout.Duration = 10 * time.Second
}
+ // Retries default to 0 (no retries) if not specified
+ if m.Retries < 0 {
+ m.Retries = 0
+ }
if m.Type == "http" || m.Type == "https" {
if m.ExpectedStatus == 0 {
m.ExpectedStatus = 200