Skip to content

Commit

Permalink
use buffered chan for sentinel logs
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
  • Loading branch information
sipsma committed Apr 22, 2024
1 parent fb3740d commit 598025f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/engine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,15 @@ func main() { //nolint:gocyclo
// TODO:
// TODO:
// TODO:
lch := make(chan time.Time, 999999)
go func() {
for t := range time.Tick(200 * time.Millisecond) {
lch <- t
}
}()
go func() {
i := 0
for range time.Tick(100 * time.Millisecond) {
for range lch {
bklog.G(ctx).Debugf("LOG SENTINEL: %d", i)
i++
}
Expand Down

0 comments on commit 598025f

Please sign in to comment.