Skip to content

Commit

Permalink
added route param to create task
Browse files Browse the repository at this point in the history
  • Loading branch information
avifenesh committed Jul 12, 2023
1 parent 23d4f5a commit 43b05fb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions node/src/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {
Expand Down

0 comments on commit 43b05fb

Please sign in to comment.