From c08436e1bc66f7c0563b088be15a18cff219b89d Mon Sep 17 00:00:00 2001 From: jmd Date: Thu, 30 Nov 2023 00:40:04 +0100 Subject: [PATCH] fixes --- src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs b/src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs index 1fbbcdd..f874895 100644 --- a/src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs +++ b/src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs @@ -90,7 +90,7 @@ public async Task RestoreSnapshotAsync(IJsonIndex index, ISnapshot sn segmentsSourceStream.Dispose(); dir.Sync(new [] { segmentsFile.Name }); - SegmentInfos.WriteSegmentsGen(dir, reader.Snapshot.Generation); + SegmentInfos.WriteSegmentsGen(dir, snapshot.Generation); //NOTE: (jmd 2020-09-30) Not quite sure what this does at this time, but the Lucene Replicator does it so better keep it for now. IndexCommit last = DirectoryReader.ListCommits(dir).Last(); @@ -100,6 +100,6 @@ public async Task RestoreSnapshotAsync(IJsonIndex index, ISnapshot sn commitFiles.Add(IndexFileNames.SEGMENTS_GEN); } index.WriterManager.Close(); - return reader.Snapshot; + return snapshot; } } \ No newline at end of file