Separate the metadata gets into additional promises since technically they are async
This commit is contained in:
parent
9170223fb0
commit
e7abac452f
|
@ -59,6 +59,8 @@ export const loadAccounts = async (connection: Connection, all: boolean) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const additionalPromises: Promise<void>[] = [];
|
||||||
|
|
||||||
const promises = [
|
const promises = [
|
||||||
connection.getProgramAccounts(VAULT_ID).then(forEach(processVaultData)),
|
connection.getProgramAccounts(VAULT_ID).then(forEach(processVaultData)),
|
||||||
connection.getProgramAccounts(AUCTION_ID).then(forEach(processAuctions)),
|
connection.getProgramAccounts(AUCTION_ID).then(forEach(processAuctions)),
|
||||||
|
@ -83,7 +85,7 @@ export const loadAccounts = async (connection: Connection, all: boolean) => {
|
||||||
|
|
||||||
for (let i = 0; i < MAX_CREATOR_LIMIT; i++) {
|
for (let i = 0; i < MAX_CREATOR_LIMIT; i++) {
|
||||||
for (let j = 0; j < whitelistedCreators.length; j++) {
|
for (let j = 0; j < whitelistedCreators.length; j++) {
|
||||||
promises.push(
|
additionalPromises.push(
|
||||||
connection
|
connection
|
||||||
.getProgramAccounts(METADATA_PROGRAM_ID, {
|
.getProgramAccounts(METADATA_PROGRAM_ID, {
|
||||||
filters: [
|
filters: [
|
||||||
|
@ -115,6 +117,7 @@ export const loadAccounts = async (connection: Connection, all: boolean) => {
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
|
await Promise.all(additionalPromises);
|
||||||
|
|
||||||
await postProcessMetadata(tempCache, all);
|
await postProcessMetadata(tempCache, all);
|
||||||
console.log('Metadata size', tempCache.metadata.length);
|
console.log('Metadata size', tempCache.metadata.length);
|
||||||
|
|
Loading…
Reference in New Issue