Skip to content

Commit

Permalink
Catch unsubscribe errors when no instance
Browse files Browse the repository at this point in the history
  • Loading branch information
cskrov committed Sep 12, 2024
1 parent 372b2f6 commit 012a1db
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/src/plugins/crdt/redis-extension/redis-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,18 @@ export class RedisExtension implements Extension {
data: { document: documentName, method: 'disconnect', identifier: this.#identifier },
});

// Time to end the subscription on the document channel.
return await this.#sub.unsubscribe(this.#getKey(documentName));
try {
// Time to end the subscription on the document channel.
await this.#sub.unsubscribe(this.#getKey(documentName));
} catch (error) {
log.error({
msg: `Failed to unsubscribe from document: "${documentName}"`,
error,
data: { document: documentName, identifier: this.#identifier },
});
}

return;
}

const document = this.instance.documents.get(documentName);
Expand Down

0 comments on commit 012a1db

Please sign in to comment.