Implemented restore function in standalone snapshot engine

This commit is contained in:
Kelvin Clement Mwinuka
2024-01-29 00:22:47 +08:00
parent d31acfbbdd
commit a081971427
2 changed files with 72 additions and 2 deletions

View File

@@ -245,8 +245,14 @@ func (server *Server) Start(ctx context.Context) {
GetState: server.GetState,
SetLatestSnapshotMilliseconds: server.SetLatestSnapshot,
GetLatestSnapshotMilliseconds: server.GetLatestSnapshot,
CreateKeyAndLock: server.CreateKeyAndLock,
KeyUnlock: server.KeyUnlock,
SetValue: server.SetValue,
})
server.SnapshotEngine.Start()
if err := server.SnapshotEngine.Restore(ctx); err != nil {
log.Println(err)
}
server.SnapshotEngine.Start(ctx)
}
server.StartTCP(ctx)