summaryrefslogtreecommitdiff
path: root/internal/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-27 18:16:04 +0200
committerPaul Buetow <paul@buetow.org>2026-01-27 18:16:04 +0200
commit115f2b371bef591a114a072794116b160fc15907 (patch)
tree8dbf5a3c710f3f1ba2e0d1d8b56e341011ef1f56 /internal/config.go
parent4dcd85d27d77439daca8223acf49e2166e0c0996 (diff)
feat: add minimum notification interval for email batching
Add MinNotifyIntervalS config option to batch email notifications over a time interval. When configured, Gogios only sends an email when: 1. The interval has elapsed since the last notification, AND 2. There's been a state change since the last notification. HTML status page and text reports continue updating on every run. The --force flag bypasses the interval for immediate notifications. Notification state (timestamp + check states snapshot) is persisted to {StateDir}/notify_state.json for comparison across runs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/config.go')
-rw-r--r--internal/config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/config.go b/internal/config.go
index c3a0d5f..ffc2353 100644
--- a/internal/config.go
+++ b/internal/config.go
@@ -21,6 +21,12 @@ type config struct {
CheckConcurrency int
StaleThreshold int `json:"StaleThreshold,omitempty"`
Federated []string `json:"Federated,omitempty"` // TODO: Document this option
+ // MinNotifyIntervalS is the minimum interval in seconds between email notifications.
+ // When set > 0, Gogios batches notifications and only sends an email when:
+ // 1. The interval has elapsed since the last notification, AND
+ // 2. There's been a state change since the last notification.
+ // Set to 0 (default) for immediate notifications on every state change.
+ MinNotifyIntervalS int `json:"MinNotifyIntervalS,omitempty"`
PrometheusHosts []string `json:"PrometheusHosts,omitempty"`
PrometheusTimeoutS int `json:"PrometheusTimeoutS,omitempty"`
PrometheusOnlyIfNotExists string `json:"PrometheusOnlyIfNotExists,omitempty"` // Suppress Prometheus alerts if this file exists and is recent