diff options
| author | Paul Buetow <paul@buetow.org> | 2025-05-29 09:23:11 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-05-29 09:23:11 +0300 |
| commit | ce6844995eaa3b1e2d50825d5490f3593cae2b8e (patch) | |
| tree | cf90d1c9602af3ff840c891687166bec066a23b0 /internal/run.go | |
| parent | 34b54e7285eb084c8fb9abc7b3b8cb90a4438f9a (diff) | |
can report stale alerts
Diffstat (limited to 'internal/run.go')
| -rw-r--r-- | internal/run.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/run.go b/internal/run.go index b48c19c..a4fbf68 100644 --- a/internal/run.go +++ b/internal/run.go @@ -35,12 +35,12 @@ func Run(ctx context.Context, configFile string, renotify, force bool) { return } } - if err := persistReport(body, conf); err != nil { + if err := persistReport(subject, body, conf); err != nil { notifyError(conf, err) } } -func persistReport(body string, conf config) error { +func persistReport(subject, body string, conf config) error { reportFile := fmt.Sprintf("%s/report.txt", conf.StateDir) tmpFile := fmt.Sprintf("%s.tmp", reportFile) @@ -50,6 +50,9 @@ func persistReport(body string, conf config) error { } defer f.Close() + if _, err = f.WriteString(fmt.Sprintf("%s\n\n", subject)); err != nil { + return err + } if _, err = f.WriteString(body); err != nil { return err } |
