From ce6844995eaa3b1e2d50825d5490f3593cae2b8e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 29 May 2025 09:23:11 +0300 Subject: can report stale alerts --- internal/run.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/run.go') 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 } -- cgit v1.2.3