From 43b05fb5a6de8993480293d67e6c49652d73f9af Mon Sep 17 00:00:00 2001 From: avifenesh Date: Wed, 12 Jul 2023 12:53:57 +0000 Subject: [PATCH] added route param to create task --- node/src/Commands.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/node/src/Commands.ts b/node/src/Commands.ts index 4f7c7e2493..45ade62aff 100644 --- a/node/src/Commands.ts +++ b/node/src/Commands.ts @@ -34,10 +34,12 @@ function isLargeCommand(args: string[]) { } return false; } +// TODO - implement route handdeling function createCommand( requestType: redis_request.RequestType, - args: string[] + args: string[], + route?: Routes ): redis_request.Command { const singleCommand = redis_request.Command.create({ requestType, @@ -64,8 +66,10 @@ export function createPing( str?: string, route?: Routes ): redis_request.Command { - if (str !== undefined) return createCommand(RequestType.Ping, [str]); - return createCommand(RequestType.Ping, []); + const args = str !== undefined ? [str] : []; + if (route !== undefined) + return createCommand(RequestType.Ping, args, route); + return createCommand(RequestType.Ping, args); } export type SetOptions = {