Skip to content

Commit

Permalink
fix: goroutine leak
Browse files Browse the repository at this point in the history
  • Loading branch information
0xff-dev committed Oct 8, 2023
1 parent 779f153 commit e96e992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/internal/utils/timedcall.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// TimedCall runs fn, failing if it doesn't complete in the given duration.
// The description is used in the timeout error message.
func TimedCall(description string, d time.Duration, fn func() error) error {
done := make(chan error)
done := make(chan error, 1)
timer := time.NewTimer(d)
defer timer.Stop()
go func() { done <- fn() }()
Expand Down

0 comments on commit e96e992

Please sign in to comment.