fix(localdb): adapter review fixes — deterministic pump teardown, always-hosted initiator, backoff clamp
Claude-Session: https://claude.ai/code/session_01BL2Vu1ESDQ9SCN4gVKkdts
This commit is contained in:
@@ -10,6 +10,16 @@ namespace ZB.MOM.WW.LocalDb.Replication.Internal;
|
||||
/// </summary>
|
||||
internal static class SyncSessionFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// The engine binds to <see cref="SqliteLocalDb"/> internals (NodeId, Clock, replicated-table
|
||||
/// digests), so both adapters require the concrete type AddZbLocalDb registers behind ILocalDb.
|
||||
/// </summary>
|
||||
public static SqliteLocalDb RequireSqlite(ILocalDb db, string consumer) =>
|
||||
db as SqliteLocalDb
|
||||
?? throw new InvalidOperationException(
|
||||
$"{consumer} requires the ILocalDb registered by AddZbLocalDb (a {nameof(SqliteLocalDb)}); " +
|
||||
$"got {db.GetType().FullName}.");
|
||||
|
||||
public static SyncSession Create(SqliteLocalDb db, ReplicationOptions options, ILoggerFactory loggerFactory)
|
||||
{
|
||||
var store = new OplogStore(db, options);
|
||||
|
||||
Reference in New Issue
Block a user