Skip to content

Commit

Permalink
Merge pull request #13 from henrywhitaker3/fix/graph-timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywhitaker3 authored May 28, 2024
2 parents fed1cb8 + 28229d0 commit dac74ab
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 dac74ab

Please sign in to comment.