mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-02-07 11:25:06 -05:00
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:
committed by
GitHub
parent
d5e6395dfd
commit
aa970d2dfe
@@ -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');
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user