Skip to content

Commit

Permalink
Move
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jun 26, 2024
1 parent 564a9df commit f69af93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/persistedmap/persistedmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ func (p *PersistedMap) flushRoutine() {
}

func (p *PersistedMap) flush() error {
p.mu.Lock()
defer p.mu.Unlock()

if !p.shouldSave {
return nil
}

p.mu.Lock()
defer p.mu.Unlock()

file, err := os.Create(p.filePath)
if err != nil {
return fmt.Errorf("failed to create file: %w", err)
Expand Down

0 comments on commit f69af93

Please sign in to comment.