fix: use full Lock in State.Save() to prevent data race (closes #17) #20

Sapludināts
sneak sapludināja 1 revīzijas no fix/state-save-data-race uz main 2026-02-21 11:22:47 +01:00

Parādīt failu

@@ -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()