diff options
| author | Fuwn <[email protected]> | 2026-01-19 04:17:50 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-19 04:17:50 -0800 |
| commit | 1e96ec397d38e6263c5369d91f2579092c9c9390 (patch) | |
| tree | b4b73accb870de9178acc931443c8cd474423fa5 /internal/config/config.go | |
| parent | feat: Add browser timezone option for client-side time display (diff) | |
| download | kaze-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.go | 5 |
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 |