Skip to content

Commit 4a562a7

Browse files
committed
agent: review core/async.go
1 parent 6596ab0 commit 4a562a7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

intra/core/async.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func Grx[T any](who string, f WorkCtx[T], d time.Duration) (zz T, completed bool
9292

9393
// errPanic returns an error indicating that the function at index i panicked.
9494
func errPanic(who string) error {
95-
return errors.New(who + "fn panicked")
95+
return errors.New(who + " fn panicked")
9696
}
9797

9898
// Race runs all the functions in fs concurrently and returns the first non-error result.
@@ -140,7 +140,7 @@ loop:
140140
} else {
141141
return r.t, r.i, r.err
142142
}
143-
case <-time.After(timeout):
143+
case <-ctx.Done():
144144
// if one of WorkCtx functions times out, it
145145
// means the rest have also lost the race.
146146
// break out of the loop and return errTimeout.

0 commit comments

Comments
 (0)