diff --git a/internal/state/state.go b/internal/state/state.go index fca7276..dd4561d 100644 --- a/internal/state/state.go +++ b/internal/state/state.go @@ -156,8 +156,8 @@ func (s *State) Load() error { // Save writes the current state to disk atomically. func (s *State) Save() error { - s.mu.RLock() - defer s.mu.RUnlock() + s.mu.Lock() + defer s.mu.Unlock() s.snapshot.LastUpdated = time.Now().UTC()