Skip to content

Commit

Permalink
Merge branch 'blockworks-foundation:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sjillen authored Dec 13, 2021
2 parents 6367487 + 8bf6fdb commit ef87d5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
22 changes: 10 additions & 12 deletions scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,24 @@ export async function getGovernanceAccounts<TAccount extends GovernanceAccount>(
)
}

const promises: Promise<Record<string, ParsedAccount<TAccount>>>[] = []
// workaround for preventing getting rate limited by public node
// 1/ for of instead of map +
// 2/ sleep a bit
let accounts: Record<string, ParsedAccount<TAccount>> = {}

for (const at of accountTypes) {
await new Promise((r) => setTimeout(r, 3000))
promises.push(
getGovernanceAccountsImpl<TAccount>(
accounts = {
...accounts,
...(await getGovernanceAccountsImpl(
programId,
endpoint,
accountClass,
at,
filters
)
)
)),
}
// XXX: sleep to prevent public RPC rate limits
await new Promise((r) => setTimeout(r, 3_000))
}

const all = await Promise.all(promises)

return all.reduce((res, r) => ({ ...res, ...r }), {})
return accounts
}

async function getGovernanceAccountsImpl<TAccount extends GovernanceAccount>(
Expand Down
3 changes: 3 additions & 0 deletions scripts/governance-notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,7 @@ async function runNotifier() {
)
}

// start notifier immediately
errorWrapper()

setInterval(errorWrapper, fiveMinutesSeconds * 1000)

2 comments on commit ef87d5a

@vercel
Copy link

@vercel vercel bot commented on ef87d5a Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

The most recent charge for your active payment method has failed. Please update it here: https://vercel.com/teams/uxdprotocol-governance/settings/billing.

@vercel
Copy link

@vercel vercel bot commented on ef87d5a Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.