Skip to content

Commit

Permalink
Only update the requestRetries from edges to avoid if its larger than…
Browse files Browse the repository at this point in the history
… our default request retry config
  • Loading branch information
urnotsam committed May 16, 2024
1 parent fc06509 commit 70c0158
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ export async function updateRequestRetries(): Promise<void> {

if (res.data && res.data.config) {
const newRotationEdgeToAvoid = res.data.config.p2p.rotationEdgeToAvoid
config.defaultRequestRetry = newRotationEdgeToAvoid * 2
if (newRotationEdgeToAvoid > config.defaultRequestRetry) {
config.defaultRequestRetry = newRotationEdgeToAvoid * 2
}
console.log(`Setting request retries to ${config.defaultRequestRetry}`)
} else if (res.data && res.data.error) {
console.log(`Error getting rotationEdgeToAvoid configuration: ${res.data.error}`)
Expand Down

0 comments on commit 70c0158

Please sign in to comment.