File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
packages/indexer-common/src/allocations Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import {
21
21
allocationSigner ,
22
22
tapAllocationIdProof ,
23
23
parseGraphQLAllocation ,
24
- sequentialTimerMap ,
25
24
} from '..'
26
25
import { BigNumber } from 'ethers'
27
26
import pReduce from 'p-reduce'
@@ -184,12 +183,8 @@ export class TapCollector {
184
183
}
185
184
186
185
private getPendingRAVs ( ) : Eventual < RavWithAllocation [ ] > {
187
- return sequentialTimerMap (
188
- {
189
- logger : this . logger ,
190
- milliseconds : RAV_CHECK_INTERVAL_MS ,
191
- } ,
192
- async ( ) => {
186
+ return this . allocations . throttle ( RAV_CHECK_INTERVAL_MS ) . tryMap (
187
+ async ( allocations ) => {
193
188
let ravs = await this . pendingRAVs ( )
194
189
if ( ravs . length === 0 ) {
195
190
this . logger . info ( `No pending RAVs to process` )
@@ -198,10 +193,10 @@ export class TapCollector {
198
193
if ( ravs . length > 0 ) {
199
194
ravs = await this . filterAndUpdateRavs ( ravs )
200
195
}
201
- const allocations : Allocation [ ] = await this . getAllocationsfromAllocationIds ( ravs )
202
- this . logger . info (
203
- `Retrieved allocations for pending RAVs \n: ${ JSON . stringify ( allocations ) } ` ,
204
- )
196
+ this . logger . debug ( `matching allocations for pending ravs` , {
197
+ allocationCount : allocations . length ,
198
+ ravCount : ravs . length ,
199
+ } )
205
200
return ravs
206
201
. map ( ( rav ) => {
207
202
const signedRav = rav . getSignedRAV ( )
You can’t perform that action at this time.
0 commit comments