Skip to content

Commit

Permalink
common: drive getPendingRAVs from allocations eventual instead of re-…
Browse files Browse the repository at this point in the history
…querying, disable jsonify of allocations
  • Loading branch information
dwerner committed Dec 27, 2024
1 parent 77a412b commit 6850b54
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/indexer-common/src/allocations/tap-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
allocationSigner,
tapAllocationIdProof,
parseGraphQLAllocation,
sequentialTimerMap,
} from '..'
import { BigNumber } from 'ethers'
import pReduce from 'p-reduce'
Expand Down Expand Up @@ -184,12 +183,8 @@ export class TapCollector {
}

private getPendingRAVs(): Eventual<RavWithAllocation[]> {
return sequentialTimerMap(
{
logger: this.logger,
milliseconds: RAV_CHECK_INTERVAL_MS,
},
async () => {
return this.allocations.throttle(RAV_CHECK_INTERVAL_MS).tryMap(
async (allocations) => {
let ravs = await this.pendingRAVs()
if (ravs.length === 0) {
this.logger.info(`No pending RAVs to process`)
Expand All @@ -198,10 +193,6 @@ export class TapCollector {
if (ravs.length > 0) {
ravs = await this.filterAndUpdateRavs(ravs)
}
const allocations: Allocation[] = await this.getAllocationsfromAllocationIds(ravs)
this.logger.info(
`Retrieved allocations for pending RAVs \n: ${JSON.stringify(allocations)}`,
)
return ravs
.map((rav) => {
const signedRav = rav.getSignedRAV()
Expand Down

0 comments on commit 6850b54

Please sign in to comment.