Skip to content

Commit

Permalink
Change content node middleware retry intervals (#1322)
Browse files Browse the repository at this point in the history
* Change middleware retry intervals

* More tweaks
  • Loading branch information
dmanjunath committed Mar 19, 2021
1 parent 2237a82 commit 78413f0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions creator-node/src/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,8 @@ async function getCreatorNodeEndpoints ({ req, wallet, blockNumber, ensurePrimar
const start2 = Date.now()

// In total, will try for 200 seconds.
const MaxRetries = 40
const RetryTimeout = 5000 // 5 seconds

// Initial delay before polling
await utils.timeout(1000)
const MaxRetries = 201
const RetryTimeout = 1000 // 1 seconds

let discprovBlockNumber = -1
for (let retry = 1; retry <= MaxRetries; retry++) {
Expand Down Expand Up @@ -277,12 +274,9 @@ async function getCreatorNodeEndpoints ({ req, wallet, blockNumber, ensurePrimar

const start2 = Date.now()

// Will poll every 5 sec for up to 1 minute (60 sec)
const MaxRetries = 12
const RetryTimeout = 5000 // 5 seconds

// Initial delay before polling
await utils.timeout(1000)
// Will poll every sec for up to 1 minute (60 sec)
const MaxRetries = 61
const RetryTimeout = 1000 // 1 seconds

let returnedPrimaryEndpoint = null
for (let retry = 1; retry <= MaxRetries; retry++) {
Expand Down

0 comments on commit 78413f0

Please sign in to comment.