fix: prune in serial (#730)

* changeset version

* fix pruning error logging

* Revert "changeset version"

This reverts commit 144fa7071a.

* prune bug investigation
This commit is contained in:
Paul Fletcher-Hill
2023-03-22 23:13:44 -04:00
committed by GitHub
parent d5e6395dfd
commit aa970d2dfe
2 changed files with 6 additions and 6 deletions

View File

@@ -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');

View File

@@ -170,7 +170,7 @@ class StoreEventHandler extends TypedEmitter<StoreEvents> {
async commitTransaction(txn: Transaction, eventArgs: HubEventArgs[]): HubAsyncResult<number[]> {
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<StoreEvents> {
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));