Fix for that pipeliner not respecting synchronicity (#551)

This commit is contained in:
Jordan Prince 2021-09-29 19:05:52 -05:00 committed by GitHub
parent e0aba9b57b
commit ecdcc40603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -272,6 +272,13 @@ export const loadAccounts = async (connection: Connection) => {
const updateState = makeSetter(state);
const forEachAccount = processingAccounts(updateState);
const forEach =
(fn: ProcessAccountsFunc) => async (accounts: AccountAndPubkey[]) => {
for (const account of accounts) {
await fn(account, updateState);
}
};
const loadVaults = () =>
getProgramAccounts(connection, VAULT_ID).then(
forEachAccount(processVaultData),
@ -291,7 +298,7 @@ export const loadAccounts = async (connection: Connection) => {
dataSize: MAX_WHITELISTED_CREATOR_SIZE,
},
],
}).then(forEachAccount(processMetaplexAccounts));
}).then(forEach(processMetaplexAccounts));
const loadMetadata = () =>
pullMetadataByCreators(connection, state, updateState);
const loadEditions = () => pullEditions(connection, updateState, state);