Skip to content

Commit

Permalink
don't update cursor as often
Browse files Browse the repository at this point in the history
  • Loading branch information
Bossett committed Sep 4, 2024
1 parent 0523b79 commit 5cb7de6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/util/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ export abstract class FirehoseSubscriptionBase {
console.error('repo subscription could not handle message', err)
}
}
}

// update stored cursor every 20 events or so
if (isCommit(evt) && evt.seq % 20 === 0) {
await this.updateCursor(evt.seq)
// update stored cursor every 100 events or so
if (isCommit(evt) && evt.seq % 100 === 0) {
await this.updateCursor(evt.seq)
}
}
}
} catch (err) {
Expand Down

0 comments on commit 5cb7de6

Please sign in to comment.