Make dashboard change notifications async and robust
Refactored DashboardChangeNotifier and IDashboardChangeNotifier to use async notification with improved error handling and logging. Updated SqlDashboardStorage to call the new async notification method after dashboard changes, ensuring non-blocking and reliable client updates.
This commit is contained in:
@@ -100,7 +100,7 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
|
||||
|
||||
connection.Open();
|
||||
command.ExecuteNonQuery();
|
||||
_notifier?.NotifyChanged();
|
||||
_ = _notifier?.NotifyChangedAsync();
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
|
||||
throw new ArgumentException($"Dashboard '{dashboardId}' not found.");
|
||||
}
|
||||
|
||||
_notifier?.NotifyChanged();
|
||||
_ = _notifier?.NotifyChangedAsync();
|
||||
}
|
||||
|
||||
public void DeleteDashboard(string dashboardId)
|
||||
@@ -133,6 +133,6 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
|
||||
|
||||
connection.Open();
|
||||
command.ExecuteNonQuery();
|
||||
_notifier?.NotifyChanged();
|
||||
_ = _notifier?.NotifyChangedAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user