Skip to content

Commit

Permalink
revert to context.TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Apr 21, 2021
1 parent 2a8152d commit 1a7fc75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/gopool.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewGoroutinePool(max int) *GoroutinePool {

// Go spawns new goroutine, but may block due to max number limit
func (p *GoroutinePool) Go(ctx context.Context, f func()) {
if err := p.sem.Acquire(ctx, 1); err != nil {
if err := p.sem.Acquire(context.TODO(), 1); err != nil {
log.Errorf("[GoroutinePool] Go acquire failed %v", err)
return
}
Expand All @@ -36,7 +36,7 @@ func (p *GoroutinePool) Go(ctx context.Context, f func()) {

// Wait is equivalent to sync.WaitGroup.Wait()
func (p *GoroutinePool) Wait(ctx context.Context) {
if err := p.sem.Acquire(ctx, p.max); err != nil {
if err := p.sem.Acquire(context.TODO(), p.max); err != nil {
log.Errorf("[GoroutinePool] Wait acquire failed %v", err)
}
}

0 comments on commit 1a7fc75

Please sign in to comment.