C# and Python: soft flush means one thing (soft-flush-cs-py) (#153)
This commit is contained in:
parent
845c024379
commit
558526c125
17 changed files with 560 additions and 32 deletions
|
|
@ -237,7 +237,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
});
|
||||
}
|
||||
|
||||
public override void PushAll()
|
||||
public override void PushAll(bool soft)
|
||||
{
|
||||
ThrowIfReadOnly();
|
||||
Held(() =>
|
||||
|
|
@ -247,7 +247,12 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
|
||||
Directory.CreateDirectory(_manifestFile.DirectoryName!);
|
||||
using var commitLease = AcquireCommitLease(wait: true, create: true);
|
||||
var (manifest, catalogBytes) = ReadManifest();
|
||||
var manifestBytes = ReadManifestBytes();
|
||||
var (manifest, catalogBytes) = ParseManifest(manifestBytes);
|
||||
// A soft flush writes only where no manifest is: the reader's answer (null is absent), not a second look at the path.
|
||||
// A manifest it read stays as it is, its staged writes staged.
|
||||
if (soft && manifestBytes != null)
|
||||
return;
|
||||
RefuseUndeclaredOnDisk(manifest, StagedKeys, Array.Empty<CultStoredDocument>(), Array.Empty<CultStoredDocument>(), Array.Empty<string>());
|
||||
if (IsDirty)
|
||||
WriteGeneration(manifest, catalogBytes);
|
||||
|
|
|
|||
Loading…
Reference in a new issue