Skip to content

Commit

Permalink
fix: Fix for how the loop sync is done (#12941)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r authored May 13, 2024
1 parent 3cc28aa commit 5cd850e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ func NewTableManager(cfg Config, openIndexFileFunc index.OpenIndexFileFunc, inde
return nil, err
}

// Increment the WaitGroup counter here before starting the goroutine
tm.wg.Add(1)
go tm.loop()
return tm, nil
}

func (tm *tableManager) loop() {
tm.tablesMtx.Lock()
tm.wg.Add(1)
tm.tablesMtx.Unlock()
defer tm.wg.Done()

syncTicker := time.NewTicker(tm.cfg.SyncInterval)
Expand Down

0 comments on commit 5cd850e

Please sign in to comment.