fix(ui): reentrancy guard on Health/AlarmSummary poll timers (arch-review S3)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -206,6 +206,7 @@
|
||||
private bool _loading;
|
||||
|
||||
private Timer? _refreshTimer;
|
||||
private readonly ZB.MOM.WW.ScadaBridge.CentralUI.Services.PollGate _pollGate = new();
|
||||
private const int _autoRefreshSeconds = 15;
|
||||
|
||||
// ── Client-side filters ──
|
||||
@@ -282,10 +283,18 @@
|
||||
StopTimer();
|
||||
_refreshTimer = new Timer(_ =>
|
||||
{
|
||||
if (!_pollGate.TryEnter()) return;
|
||||
InvokeAsync(async () =>
|
||||
{
|
||||
await RefreshAsync();
|
||||
StateHasChanged();
|
||||
try
|
||||
{
|
||||
await RefreshAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_pollGate.Exit();
|
||||
}
|
||||
});
|
||||
}, null, TimeSpan.FromSeconds(_autoRefreshSeconds), TimeSpan.FromSeconds(_autoRefreshSeconds));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user