summaryrefslogtreecommitdiff
path: root/internal/state.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-04-20 23:37:06 +0300
committerPaul Buetow <paul@buetow.org>2023-04-20 23:37:06 +0300
commit7fa1d0c1e3fb7ceb23ba3d88a93905d68522c930 (patch)
tree9bbc3e525b9d74ca3a2e1f7b8e7cb77b83154b11 /internal/state.go
parent1770bba5519236198c5d1a597507e1cb79da16e5 (diff)
add renotify
Diffstat (limited to 'internal/state.go')
-rw-r--r--internal/state.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/state.go b/internal/state.go
index 0cba723..d318ca9 100644
--- a/internal/state.go
+++ b/internal/state.go
@@ -85,7 +85,7 @@ func (s state) persist() error {
return ioutil.WriteFile(s.stateFile, jsonData, os.ModePerm)
}
-func (s state) report() (string, string, bool) {
+func (s state) report(renotify bool) (string, string, bool) {
var sb strings.Builder
sb.WriteString("This is the recent Gogios report!\n\n")
@@ -101,7 +101,7 @@ func (s state) report() (string, string, bool) {
subject := fmt.Sprintf("GOGIOS Report [C:%d W:%d U:%d OK:%d]",
numCriticals, numWarnings, numUnknown, numOK)
- return subject, sb.String(), changed || numCriticals > 0
+ return subject, sb.String(), changed || (renotify && (numCriticals+numWarnings+numUnknown) > 0)
}
func (s state) reportChanged(sb *strings.Builder) (changed bool) {