feat(historian): SQL Server retention purge (RetentionDays, Primary-gated, applock) (#667)
This commit is contained in:
@@ -326,6 +326,14 @@ if (hasDriver)
|
||||
builder.Services.AddSingleton<IHistorianValueWriter>(sp => sp.GetRequiredService<IHistorianBackendProvider>().CreateValueWriter(sp));
|
||||
}
|
||||
|
||||
// Historian retention (#667). Only a backend that manages retention in-process returns a purger
|
||||
// (SqlServer with RetentionDays set); otherwise the service is inert. Primary-gated via IHistorizationRoleView.
|
||||
if (serverHistorianOptions.Enabled)
|
||||
builder.Services.AddHostedService(sp => new HistorianRetentionService(
|
||||
sp.GetRequiredService<IHistorianBackendProvider>().CreateRetention(sp),
|
||||
sp.GetService<ZB.MOM.WW.OtOpcUa.Runtime.Redundancy.IHistorizationRoleView>(),
|
||||
sp.GetService<ILogger<HistorianRetentionService>>()));
|
||||
|
||||
// Bind every cross-platform driver factory before AddAkka resolves IDriverFactory — replaces
|
||||
// the F7-default NullDriverFactory with a real DriverFactoryRegistryAdapter so DriverHostActor
|
||||
// can materialise real IDriver instances on deploy.
|
||||
|
||||
Reference in New Issue
Block a user