Added RWMutex to keysWithExpiry in order to improve thread safety

This commit is contained in:
Kelvin Mwinuka
2024-03-11 02:10:23 +08:00
parent 8cc8f6c02c
commit 8000cef72d
4 changed files with 78 additions and 37 deletions

View File

@@ -119,6 +119,10 @@ func (r *Raft) RaftInit(ctx context.Context) {
}
r.raft = raftServer
// TODO
// Listen on leadership change channel and initiate key eviction goroutine
// if current node is the leader.
}
func (r *Raft) Apply(cmd []byte, timeout time.Duration) raft.ApplyFuture {