feat(historian): SQL Server retention purge (RetentionDays, Primary-gated, applock) (#667)
This commit is contained in:
@@ -96,5 +96,14 @@ public sealed class SqlServerHistorianProvider : IHistorianBackendProvider
|
||||
return new SqlServerHistorianDataUpdater(s.Conn, s.Catalog);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IHistorianRetention? CreateRetention(IServiceProvider sp)
|
||||
{
|
||||
if (_options.RetentionDays is not { } days) return null;
|
||||
var s = Get(sp);
|
||||
return new SqlServerHistorianRetention(s.Conn, s.Bootstrap, _options.PurgeInterval, days,
|
||||
_options.PurgeBatchSize, Loggers(sp).CreateLogger<SqlServerHistorianRetention>());
|
||||
}
|
||||
|
||||
private sealed record Shared(SqlHistorianConnection Conn, SqlServerSchemaBootstrapper Bootstrap, SqlServerTagCatalog Catalog);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user