Skip to content

Commit

Permalink
Healing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Sep 23, 2024
1 parent 782ad6e commit 698f0a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/cmd/debug/heal_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func (h *healer) Reset() {
}

func (h *healer) heal(args []string) {
// Wait must be called after cancel (so the defer must happen first)
wg := new(sync.WaitGroup)
defer wg.Wait()

ctx := cmdutil.ContextForMainProcess(context.Background())
ctx, cancel, _ := api.ContextWithBatchData(ctx)
defer cancel()
Expand Down Expand Up @@ -177,9 +181,6 @@ func (h *healer) heal(args []string) {
},
}

wg := new(sync.WaitGroup)
defer wg.Wait()

h.submit = make(chan []messaging.Message)
wg.Add(1)
go h.submitLoop(wg)
Expand Down

0 comments on commit 698f0a4

Please sign in to comment.