perf(adminui): drift chip recomposes only when the config-edit watermark moves
This commit is contained in:
@@ -3,12 +3,14 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
|
||||
using ZB.MOM.WW.OtOpcUa.AdminUI.Uns;
|
||||
using ZB.MOM.WW.OtOpcUa.Commons.Browsing;
|
||||
using ZB.MOM.WW.OtOpcUa.Configuration;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser;
|
||||
@@ -103,6 +105,13 @@ public static class EndpointRouteBuilderExtensions
|
||||
// TryAdd so a host that already bound a clock (test harness, future fused-host registration) wins.
|
||||
services.TryAddSingleton<TimeProvider>(TimeProvider.System);
|
||||
|
||||
// /deployments drift chip. A singleton so its ConfigEdit-watermark cache is shared across
|
||||
// circuits — otherwise every page load would recompose the whole fleet configuration.
|
||||
// Constructed explicitly rather than by ctor scan: the compose seam is an optional parameter
|
||||
// that only tests supply, and production must always get the real ConfigComposer default.
|
||||
services.AddSingleton(sp => new Deployments.DeploymentDriftProbe(
|
||||
sp.GetRequiredService<IDbContextFactory<OtOpcUaConfigDbContext>>()));
|
||||
|
||||
// Certificate-store actions (trust/untrust/delete) for the /certificates page.
|
||||
services.AddSingleton<Certificates.CertificateStoreManager>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user