Skip to content

Commit

Permalink
fix(cdp): try not to race on redis shutdown (PostHog#25950)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Nov 8, 2024
1 parent e79c306 commit 7cfd244
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin-server/src/utils/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ export class PubSub {
}

await this.redisSubscriber.unsubscribe()
this.redisSubscriber.disconnect()
if (this.redisSubscriber) {
this.redisSubscriber.disconnect()
}
this.redisSubscriber = undefined

if (this.redisPublisher) {
const redisPublisher = await this.redisPublisher
redisPublisher.disconnect()
if (redisPublisher) {
redisPublisher.disconnect()
}
this.redisPublisher = undefined
}

Expand Down

0 comments on commit 7cfd244

Please sign in to comment.