Skip to content

Commit

Permalink
Skip logs/throttle when grants loaded in a batch
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Apr 4, 2023
1 parent 2c09868 commit 98df45f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/autostake/NetworkRunner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ export default class NetworkRunner {
}
})
let grantedAddresses = await mapSync(grantCalls, this.opts.batchQueries, (batch, index) => {
timeStamp('...batch', index + 1)
return this.throttleQuery()
if(!allGrants){
timeStamp('...batch', index + 1)
return this.throttleQuery()
}
})
return _.compact(grantedAddresses.flat())
}
Expand Down Expand Up @@ -314,7 +316,7 @@ export default class NetworkRunner {
}

async throttleQuery(){
if(!this.opts.queryThrottle) return
if(!this.opts.queryThrottle) return

await new Promise(r => setTimeout(r, this.opts.queryThrottle));
}
Expand Down

0 comments on commit 98df45f

Please sign in to comment.