Skip to content

Commit

Permalink
Temporary fix GetRewardsAccumulated api issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonLewis committed Jul 16, 2024
1 parent 39ec6ac commit 994c90e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions governance/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ func (api *GovernanceAPI) GetRewardsAccumulated(first rpc.BlockNumber, last rpc.
mu := sync.Mutex{} // protect blockRewards

numWorkers := runtime.NumCPU()
reqCh := make(chan uint64, numWorkers)
errCh := make(chan error, numWorkers+1)
// TODO-api: Fix hanging issue when requested range is over numWorkers considering goroutine scheduling
reqCh := make(chan uint64, blockCount)
errCh := make(chan error, blockCount+1)
wg := sync.WaitGroup{}

// introduce the worker pattern to prevent resource exhaustion
Expand Down

0 comments on commit 994c90e

Please sign in to comment.