Skip to content

Commit

Permalink
Removed restore context parameters in AOFEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinmwinuka committed Feb 25, 2024
1 parent 8d7fe02 commit 83f0709
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/server/aof/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/server/aof/log/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package log
import (
"bufio"
"bytes"
"context"
"errors"
"io"
"log"
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 83f0709

Please sign in to comment.