C#: soft flush skips a readable store and keeps staged writes dirty; Mesh and CultNetLocal pass the flag
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled

CacheBackingStore.PushAll(bool soft) is the one abstract owner; PushAll() stays as the plain call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-12 22:33:01 +00:00
commit 0a1486eccd
10 changed files with 103 additions and 16 deletions

View file

@ -237,7 +237,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
});
}
public override void PushAll()
public override void PushAll(bool soft)
{
ThrowIfReadOnly();
Held(() =>
@ -248,6 +248,9 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
Directory.CreateDirectory(_manifestFile.DirectoryName!);
using var commitLease = AcquireCommitLease(wait: true, create: true);
var (manifest, catalogBytes) = ReadManifest();
// A soft flush writes only where no manifest is; a manifest ReadManifest read stays as it is, its staged writes staged.
if (soft && File.Exists(_manifestFile.FullName))
return;
RefuseUndeclaredOnDisk(manifest, StagedKeys, Array.Empty<CultStoredDocument>(), Array.Empty<CultStoredDocument>(), Array.Empty<string>());
if (IsDirty)
WriteGeneration(manifest, catalogBytes);