Skip to content

Commit

Permalink
fix: bug causing intermittent timeouts when loading a service page
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywhitaker3 committed May 28, 2024
1 parent fed1cb8 commit 28229d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/resources/views/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,16 @@ func chunk(items []collector.SeriesItem, perBucket, buckets int) [][]collector.S

// Pull the last item out so it doesn't leak goroutines every graph load
run = false
<-feed
// If there is noting to pull out, then this will block, so run it in its
// own goroutine with a timeout
go func() {
select {
case <-time.After(time.Second):
return
case <-feed:
return
}
}()

return out
}
Expand Down

0 comments on commit 28229d0

Please sign in to comment.