Skip to content

Commit 70f7d1f

Browse files
committed
core/async: goroutine leak on timeout as reader quits
1 parent 7e6b59d commit 70f7d1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intra/core/async.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func Gif(cond bool, who string, f func()) {
6868

6969
// Grx runs work function f in a goroutine, blocking until it returns or timesout.
7070
func Grx[T any](who string, f WorkCtx[T], d time.Duration) (zz T, completed bool) {
71-
ch := make(chan T) // synchronous
71+
ch := make(chan T, 1) // non-blocking
7272

7373
ctx, cancel := context.WithTimeout(context.Background(), d)
7474
defer cancel()

0 commit comments

Comments
 (0)