diff --git a/internal/server/aof.go b/internal/server/aof.go index 53d1a42e..10d2a152 100644 --- a/internal/server/aof.go +++ b/internal/server/aof.go @@ -169,6 +169,7 @@ func (server *Server) writeAOF(args []string, d *commandDetailsT) error { } } } + // live geofences server.lcond.L.Lock() if d.parent { diff --git a/internal/server/atomic.go b/internal/server/atomic.go index 706e2cdf..97e9a4cb 100644 --- a/internal/server/atomic.go +++ b/internal/server/atomic.go @@ -1,9 +1,7 @@ package server import ( - "sync" "sync/atomic" - "time" ) type aint struct{ v uintptr } @@ -32,41 +30,3 @@ func (a *abool) set(t bool) bool { } return atomic.SwapUint32(&a.v, 0) != 0 } - -type astring struct { - mu sync.Mutex - v string -} - -func (a *astring) get() string { - a.mu.Lock() - p := a.v - a.mu.Unlock() - return p -} -func (a *astring) set(s string) string { - a.mu.Lock() - p := a.v - a.v = s - a.mu.Unlock() - return p -} - -type atime struct { - mu sync.Mutex - v time.Time -} - -func (a *atime) get() time.Time { - a.mu.Lock() - p := a.v - a.mu.Unlock() - return p -} -func (a *atime) set(t time.Time) time.Time { - a.mu.Lock() - p := a.v - a.v = t - a.mu.Unlock() - return p -} diff --git a/internal/server/server.go b/internal/server/server.go index c6338a7e..ea4b83f3 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -80,7 +80,6 @@ type Server struct { statsTotalCommands aint // counter for total commands statsExpired aint // item expiration counter lastShrinkDuration aint - currentShrinkStart atime stopBackgroundExpiring abool stopWatchingMemory abool stopWatchingAutoGC abool diff --git a/internal/server/stats.go b/internal/server/stats.go index 1c33d972..8a1cfbbc 100644 --- a/internal/server/stats.go +++ b/internal/server/stats.go @@ -160,7 +160,8 @@ func (c *Server) writeInfoPersistence(w *bytes.Buffer) { fmt.Fprintf(w, "aof_enabled:1\r\n") fmt.Fprintf(w, "aof_rewrite_in_progress:%d\r\n", boolInt(c.shrinking)) // Flag indicating a AOF rewrite operation is on-going fmt.Fprintf(w, "aof_last_rewrite_time_sec:%d\r\n", c.lastShrinkDuration.get()/int(time.Second)) // Duration of the last AOF rewrite operation in seconds - currentShrinkStart := c.currentShrinkStart.get() + + var currentShrinkStart time.Time // c.currentShrinkStart.get() if currentShrinkStart.IsZero() { fmt.Fprintf(w, "aof_current_rewrite_time_sec:0\r\n") // Duration of the on-going AOF rewrite operation if any } else {