P4.1: Wire desktop notifications for failed job runs
Add Service.ShouldNotifyOnFailure() (reads config under mu) and call fyne.CurrentApp().SendNotification in the mainwindow subscriber when a Manual/Schedule run completes with State == "Failed" and the setting is on. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,15 @@ func (s *Service) SetGlobalPause(paused bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// ShouldNotifyOnFailure reports whether the user has enabled desktop
|
||||
// notifications for failed job runs. It reads the config under mu so it is
|
||||
// safe to call from any goroutine.
|
||||
func (s *Service) ShouldNotifyOnFailure() bool {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
return s.store.Config.NotifyOnFailure
|
||||
}
|
||||
|
||||
// UpdateSettings validates and persists a new application configuration. The
|
||||
// loaded jobs are re-saved because the jobs directory may have changed, and log
|
||||
// cleanup runs so a tightened retention policy takes effect immediately.
|
||||
|
||||
Reference in New Issue
Block a user