fix(comm): site delete disposes the site's cached gRPC channels via RemoveSiteAsync (plan R2-02 T13)
This commit is contained in:
@@ -1583,6 +1583,18 @@ public class ManagementActor : ReceiveActor
|
||||
await repo.SaveChangesAsync();
|
||||
var commService = sp.GetService<CommunicationService>();
|
||||
commService?.RefreshSiteAddresses();
|
||||
|
||||
// Dispose the deleted site's cached gRPC channels — RemoveSiteAsync is the
|
||||
// factory's designed site-deletion disposal path and previously had no
|
||||
// production caller (arch review 02 round 2, N8): a deleted site's channels
|
||||
// (both node endpoints) otherwise persist until process restart. Null-safe:
|
||||
// test/composition roots without the factory skip it. Any live-alarm
|
||||
// aggregator for the site reconciles to an empty snapshot and is reaped by
|
||||
// the viewer linger (documented acceptance — see Component-Communication.md).
|
||||
var grpcFactory = sp.GetService<ZB.MOM.WW.ScadaBridge.Communication.Grpc.SiteStreamGrpcClientFactory>();
|
||||
if (grpcFactory is not null && site is not null)
|
||||
await grpcFactory.RemoveSiteAsync(site.SiteIdentifier);
|
||||
|
||||
await AuditAsync(sp, user, "Delete", "Site", cmd.SiteId.ToString(), site?.Name ?? cmd.SiteId.ToString(), null);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user