Skip to content

Commit

Permalink
Return on subscription abort (bluesky-social#921)
Browse files Browse the repository at this point in the history
return on subscription abort
  • Loading branch information
dholms authored Apr 28, 2023
1 parent 6b3d5c1 commit 63bef85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/pds/src/sequencer/outbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class Outbox {
// catch up as much as we can
if (backfillCursor !== undefined) {
for await (const evt of this.getBackfill(backfillCursor, backFillTime)) {
if (signal?.aborted) return
this.lastSeen = evt.seq
yield evt
}
Expand Down Expand Up @@ -81,6 +82,7 @@ export class Outbox {
while (true) {
try {
for await (const evt of this.outBuffer.events()) {
if (signal?.aborted) return
if (evt.seq > this.lastSeen) {
this.lastSeen = evt.seq
yield evt
Expand Down

0 comments on commit 63bef85

Please sign in to comment.