Skip to content

Commit

Permalink
fix: keep sendLog async
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya committed Feb 15, 2024
1 parent d600173 commit 0b6e10a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ func (p *podEventLogger) sendLog(resourceName, token string, log agentsdk.Startu
// If the logger was already closed, we await the close before
// creating a new logger. This is to ensure all loggers get sent in order!
_ = logger.closer.Close()
p.sendLog(resourceName, token, log)
go func() {
p.mutex.Lock()
defer p.mutex.Unlock()
p.sendLog(resourceName, token, log)
}()
return
}
// We make this 5x the debounce because it's low-cost to persist a few
Expand Down

0 comments on commit 0b6e10a

Please sign in to comment.