diff --git a/apps/hubble/src/storage/jobs/pruneMessagesJob.ts b/apps/hubble/src/storage/jobs/pruneMessagesJob.ts index 8a23d50c..0f2d6675 100644 --- a/apps/hubble/src/storage/jobs/pruneMessagesJob.ts +++ b/apps/hubble/src/storage/jobs/pruneMessagesJob.ts @@ -51,7 +51,9 @@ export class PruneMessagesJobScheduler { pageToken = nextPageToken; } - await Promise.all(fids.map((fid) => this._engine.pruneMessages(fid))); + for (const fid of fids) { + await this._engine.pruneMessages(fid); + } } while (!finished); log.info({}, 'finished prune messages job'); diff --git a/apps/hubble/src/storage/stores/storeEventHandler.ts b/apps/hubble/src/storage/stores/storeEventHandler.ts index b5b22f47..0ef411a8 100644 --- a/apps/hubble/src/storage/stores/storeEventHandler.ts +++ b/apps/hubble/src/storage/stores/storeEventHandler.ts @@ -170,7 +170,7 @@ class StoreEventHandler extends TypedEmitter { async commitTransaction(txn: Transaction, eventArgs: HubEventArgs[]): HubAsyncResult { return this._lock - .acquire('default', async () => { + .acquire('commit', async () => { const events: HubEvent[] = []; for (const args of eventArgs) { @@ -187,10 +187,8 @@ class StoreEventHandler extends TypedEmitter { await this._db.commit(txn); for (const event of events) { - if (this._storageCache) { - this._storageCache.processEvent(event); - } - this.broadcastEvent(event); + void this._storageCache.processEvent(event); + void this.broadcastEvent(event); } return ok(events.map((event) => event.id));