Skip to content

Commit

Permalink
fix: Delay in proper place
Browse files Browse the repository at this point in the history
  • Loading branch information
Apegurus committed Oct 24, 2024
1 parent f30ccaa commit 86f35f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion adapters/lynex/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const getUserStakedTVLByBlock = async ({
let userPoolFetch = [];
let userVotesFetch = [];

const batchSize = 400;
const batchSize = 100;
let position = 0;
let userFetchResult: any = [];
let userVotesResult: any = [];
Expand All @@ -112,6 +112,9 @@ export const getUserStakedTVLByBlock = async ({
...(await Promise.all(userVotesFetch)),
];
userVotesFetch = [];
console.timeEnd("Batch");
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
await delay(60000)
}
position++;
}
Expand Down
2 changes: 1 addition & 1 deletion adapters/lynex/src/sdk/lensDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const fetchUserPools = async (
blockNumber
)) as any;
const delay = (ms: number | undefined) => new Promise(resolve => setTimeout(resolve, ms))
await delay(10000)
await delay(3000)
return res.map((r: any) => {
if (r.status !== 'success') {
throw new Error("RPC call error. Status: " + r.status);
Expand Down

0 comments on commit 86f35f7

Please sign in to comment.