mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
Fix Redis reusing same property as (#10336)
The collaborationClient getter was incorrectly reusing the same this.client property as defaultClient, causing it to return the already-initialized connection to the main Redis instead of creating a new connection to REDIS_COLLABORATION_URL. This fix adds a separate private static collabClient property to maintain a separate connection for collaboration operations. Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
This commit is contained in:
@@ -76,6 +76,7 @@ export default class RedisAdapter extends Redis {
|
||||
|
||||
private static client: RedisAdapter;
|
||||
private static subscriber: RedisAdapter;
|
||||
private static collabClient: RedisAdapter;
|
||||
|
||||
public static get defaultClient(): RedisAdapter {
|
||||
return (
|
||||
@@ -101,8 +102,8 @@ export default class RedisAdapter extends Redis {
|
||||
*/
|
||||
public static get collaborationClient(): RedisAdapter {
|
||||
return (
|
||||
this.client ||
|
||||
(this.client = new this(env.REDIS_COLLABORATION_URL, {
|
||||
this.collabClient ||
|
||||
(this.collabClient = new this(env.REDIS_COLLABORATION_URL, {
|
||||
connectionNameSuffix: "collab",
|
||||
}))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user