From 83f070986d67005ffb54e4f2d580481820fc64a3 Mon Sep 17 00:00:00 2001 From: Kelvin Clement Mwinuka Date: Sun, 25 Feb 2024 15:19:16 +0800 Subject: [PATCH] Removed restore context parameters in AOFEngine --- src/server/aof/engine.go | 6 +++--- src/server/aof/log/store.go | 3 +-- src/server/server.go | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server/aof/engine.go b/src/server/aof/engine.go index b6712391..5b643f49 100644 --- a/src/server/aof/engine.go +++ b/src/server/aof/engine.go @@ -106,11 +106,11 @@ func (engine *Engine) RewriteLog() error { return nil } -func (engine *Engine) Restore(ctx context.Context) error { - if err := engine.preambleStore.Restore(ctx); err != nil { +func (engine *Engine) Restore() error { + if err := engine.preambleStore.Restore(); err != nil { log.Println(err) } - if err := engine.appendStore.Restore(ctx); err != nil { + if err := engine.appendStore.Restore(); err != nil { log.Println(err) } return nil diff --git a/src/server/aof/log/store.go b/src/server/aof/log/store.go index 892ecd90..1c4e5fbe 100644 --- a/src/server/aof/log/store.go +++ b/src/server/aof/log/store.go @@ -3,7 +3,6 @@ package log import ( "bufio" "bytes" - "context" "errors" "io" "log" @@ -112,7 +111,7 @@ func (store *AppendStore) Sync() error { return store.rw.Sync() } -func (store *AppendStore) Restore(ctx context.Context) error { +func (store *AppendStore) Restore() error { store.mut.Lock() defer store.mut.Unlock() diff --git a/src/server/server.go b/src/server/server.go index 1e423349..22584bdb 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -244,7 +244,7 @@ func (server *Server) Start(ctx context.Context) { } else { // Restore from AOF by default if it's enabled if conf.RestoreAOF { - err := server.AOFEngine.Restore(ctx) + err := server.AOFEngine.Restore() if err != nil { log.Println(err) }