diff options
Diffstat (limited to 'cmd/main/main.go')
| -rw-r--r-- | cmd/main/main.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/main/main.go b/cmd/main/main.go index 1b264a3..531b0ab 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -19,6 +19,7 @@ type jobResponse struct { Id string Message string Err error + Time time.Time } type Config struct { @@ -31,6 +32,7 @@ type Config struct { StatusChecks map[string]*int `yaml:"StatusChecks"` Workers int `yaml:"Workers"` Interval int `yaml:"Interval"` + RenotifyInterval int `yaml:"RenotifyInterval"` HTTPTimeout int `yaml:"HTTPTimeout"` } @@ -57,6 +59,18 @@ func jobNotifyDedup(conf *Config, prevJobs, newJobs map[string]*jobResponse) { } if oldresp.Message == resp.Message { + // This isn't new, adjust accordingly + newJobs[id] = prevJobs[id] + + if time.Now().After( + oldresp.Time.Add(time.Duration(conf.RenotifyInterval) * time.Second)) { + + buf.Write([]byte( + "still active --> " + resp.Message, + )) + buf.Write([]byte{'\n'}) + } + continue } @@ -134,6 +148,7 @@ func main() { CertWindow: 15, ExpectedStatusCode: 200, Interval: 60, + RenotifyInterval: 900, } err := ReadConfig(*confFn, conf) |
