mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-04-29 05:15:32 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user