Skip to content

Commit 41f12d5

Browse files
committed
fix(maint): use factory to create tmp client
1 parent 6998a0a commit 41f12d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/client/lib/client/enterprise-maintenance-manager.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RedisClientOptions } from ".";
1+
import RedisClient, { RedisClientOptions } from ".";
22
import RedisCommandsQueue from "./commands-queue";
33
import { RedisArgument } from "../..";
44
import { isIP } from "net";
@@ -183,14 +183,15 @@ export default class EnterpriseMaintenanceManager {
183183

184184
dbgMaintenance("Creating new tmp client");
185185
const start = performance.now();
186-
const tmpClient = this.#client.duplicate({
187-
maintPushNotifications: "disabled",
186+
const options = ({
187+
...this.#options,
188188
socket: {
189189
...this.#options.socket,
190190
host,
191191
port,
192-
},
192+
}
193193
});
194+
const tmpClient = RedisClient.factory(options)(options);
194195
dbgMaintenance(`Tmp client created in ${( performance.now() - start ).toFixed(2)}ms`);
195196
dbgMaintenance(`Connecting tmp client: ${host}:${port}`);
196197
await tmpClient.connect();

0 commit comments

Comments
 (0)