Controller v0.7.2: notification preferences sync to hub
- SyncPreferences() method on Notifier: POST to hub /api/v1/preferences - IsEnabled() getter for hub connectivity check - settingsNotificationsHandler: sync to hub after local save (3 flash message variants) - Startup sync: non-blocking goroutine pushes prefs to hub on boot (DB rebuild recovery) - Updated CONTEXT.md, README.md with v0.7.2 changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -237,6 +237,18 @@ func main() {
|
||||
}()
|
||||
}
|
||||
|
||||
// Sync notification preferences to hub on startup (handles hub DB rebuild recovery)
|
||||
if notifier.IsEnabled() {
|
||||
go func() {
|
||||
prefs := sett.GetNotificationPrefs()
|
||||
if prefs.Email != "" {
|
||||
if err := notifier.SyncPreferences(prefs.Email, prefs.EnabledEvents); err != nil {
|
||||
logger.Printf("[WARN] Failed to sync notification preferences on startup: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// Initial alert refresh (so alerts appear immediately, not after first 5min health check)
|
||||
go func() {
|
||||
report := monitor.RunHealthCheck(cfg, cpuCollector)
|
||||
|
||||
Reference in New Issue
Block a user