Skip to content

Commit

Permalink
Fix broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
puzpuzpuz committed Aug 13, 2024
1 parent 1e56245 commit 1b442eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sender_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ func (p *LineSenderPool) free(ctx context.Context, ps *pooledSender) error {

p.mu.Lock()
defer p.mu.Unlock()
// Notify free sender waiters, if any
defer p.cond.Broadcast()

if flushErr != nil {
// Failed to flush, close and call it a day
Expand All @@ -215,8 +217,6 @@ func (p *LineSenderPool) free(ctx context.Context, ps *pooledSender) error {
}

p.freeSenders = append(p.freeSenders, ps)
// Notify free sender waiters, if any
p.cond.Broadcast()
return nil
}

Expand Down

0 comments on commit 1b442eb

Please sign in to comment.