Skip to content

Conversation

@waynebruce0x
Copy link
Contributor

No description provided.

return bodies;
}

function sleep(ms: number) {
Copy link
Member

Choose a reason for hiding this comment

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

this we already have defined sleep somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cant find a timeout/sleep anywhere else in the codebase

Copy link
Member

Choose a reason for hiding this comment

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

so, there was sleep already here

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

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

why remove the price cache?
can you also cache mcap response?

@g1nt0ki g1nt0ki marked this pull request as ready for review October 22, 2025 13:57
@g1nt0ki g1nt0ki merged commit f41fac3 into master Oct 22, 2025
@g1nt0ki g1nt0ki deleted the coins-api branch October 22, 2025 14:17
};

const coinsApiKey = getEnvValue("COINS_API_KEY")
const bodySize = 2; // 100;
Copy link
Member

Choose a reason for hiding this comment

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

this was test code should have reverted back to 100

return res;
} catch {
await sleep(5_000 + 10_000 * Math.random());
restCallWrapper(request, retries--, name);
Copy link
Member

Choose a reason for hiding this comment

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

missing await, and why both recursive call and a while loop, should have been one or the other

readKeys = readKeys.filter((PK: string) => {
if (timestamp !== "now") return true;
if (priceCache[PK]) {
aggregatedRes[PK] = { ...priceCache[PK], PK };
Copy link
Member

Choose a reason for hiding this comment

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

you read from the cache, but there is no code that sets to the cache


const bodies = getBodies(readKeys, timestamp);
const tokenData: CoinsApiData[][] = [];
await runInPromisePool({
Copy link
Member

Choose a reason for hiding this comment

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

lot of code duplication between /prices and /mcaps call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants