Skip to content

Commit

Permalink
larger queue, more concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
Bossett committed Jan 1, 2025
1 parent c856ed3 commit 96c01bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import WebSocket from 'ws'

import { Semaphore } from 'async-mutex'

const semaphore = new Semaphore(16)
const semaphore = new Semaphore(128)

const includedRecords = new Set(['app.bsky.feed.post'])

Expand All @@ -38,7 +38,7 @@ export abstract class FirehoseSubscriptionBase {
this.jetstream.on('commit', (event) => {
eventQueue.push(event)
if (
eventQueue.length > 1000 &&
eventQueue.length > 10000 &&
this.jetstream.ws?.readyState === WebSocket.OPEN
) {
console.log('core: queue too large, closing jetstream...')
Expand Down

0 comments on commit 96c01bc

Please sign in to comment.