Skip to content

Commit

Permalink
Use thread control
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Oct 17, 2023
1 parent a5f915f commit 996acf0
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"math/big"
"strings"
"sync"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -41,16 +40,11 @@ func (r *EvmRegistry) CheckUpkeeps(ctx context.Context, keys ...ocr2keepers.Upke
}
}

var wg sync.WaitGroup
wg.Add(1)
defer wg.Wait()

chResult := make(chan checkResult, 1)

go func() {
defer wg.Done()
r.threadCtrl.Go(func(ctx context.Context) {
r.doCheck(ctx, keys, chResult)
}()
})

select {
case rs := <-chResult:
Expand Down

0 comments on commit 996acf0

Please sign in to comment.