fix: prevent token metadata processor from blocking api launch (#1514)

* fix: prevent token metadata processor from blocking api launch

* fix: only check queue on block update
This commit is contained in:
Rafael Cárdenas
2023-01-13 10:34:10 -06:00
committed by GitHub
parent 5a5f07c6d3
commit 63da7e140b
2 changed files with 3 additions and 4 deletions

View File

@@ -163,8 +163,8 @@ async function init(): Promise<void> {
handler: () => tokenMetadataProcessor.close(),
forceKillable: true,
});
// check if db has any non-processed token queues and await them all here
await tokenMetadataProcessor.drainDbQueue();
// Enqueue a batch of pending token metadata processors, if any.
await tokenMetadataProcessor.checkDbQueue();
}
}

View File

@@ -109,8 +109,7 @@ export class TokensProcessorQueue {
}
async blockNotificationHandler(_: string) {
// Every block, check if we have entries we still need to process.
await this.drainDbQueue();
await this.checkDbQueue();
}
async queueHandler(queueEntry: TokenMetadataUpdateInfo) {