Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeme committed Nov 29, 2023
1 parent 4500b47 commit c08436e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DotJEM.Json.Index2.Snapshots/IndexSnapshotHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task<ISnapshot> 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();
Expand All @@ -100,6 +100,6 @@ public async Task<ISnapshot> RestoreSnapshotAsync(IJsonIndex index, ISnapshot sn
commitFiles.Add(IndexFileNames.SEGMENTS_GEN);
}
index.WriterManager.Close();
return reader.Snapshot;
return snapshot;
}
}

0 comments on commit c08436e

Please sign in to comment.