Skip to content

Commit

Permalink
fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
avifenesh committed Mar 13, 2024
1 parent df7c33b commit 3105365
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Node: Added ZREMRANGEBYRANK command ([#924](https://github.com/aws/glide-for-redis/pull/924))
* Node: Added Xadd, Xtrim commands. ([#1057](https://github.com/aws/glide-for-redis/pull/1057))
* Python: Added json module and JSON.SET JSON.GET commands ([#1056](https://github.com/aws/glide-for-redis/pull/1056))
* Node: Added Time command. ([1114](https://github.com/aws/glide-for-redis/pull/1114))
* Node: Added Time command. ([#1114](https://github.com/aws/glide-for-redis/pull/1114))

#### Features

Expand Down
3 changes: 2 additions & 1 deletion node/src/RedisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ export class RedisClient extends BaseClient {
*
* @returns - The current server time as a two items `array`:
* A Unix timestamp and the amount of microseconds already elapsed in the current second.
* The returned `array` is in a [Unix timestamp, Microseconds already elapsed] format.
*/
public time(): Promise<[number, number]> {
public time(): Promise<[string, string]> {
return this.createWritePromise(createTime());
}
}
4 changes: 2 additions & 2 deletions node/src/RedisClusterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ export class RedisClusterClient extends BaseClient {
*
* @param route - The command will be routed to a random node, unless `route` is provided, in which
* case the client will route the command to the nodes defined by `route`.
* If `route` is not provided, the command will be sent to a random node.
*
* @returns - The current server time as a two items `array`:
* A Unix timestamp and the amount of microseconds already elapsed in the current second.
* The returned `array` is in a [Unix timestamp, Microseconds already elapsed] format.
*/
public time(route?: Routes): Promise<[number, number]> {
public time(route?: Routes): Promise<[string, string]> {
return this.createWritePromise(createTime(), toProtobufRoute(route));
}
}
1 change: 1 addition & 0 deletions node/src/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
*
* @returns - The current server time as a two items `array`:
* A Unix timestamp and the amount of microseconds already elapsed in the current second.
* The returned `array` is in a [Unix timestamp, Microseconds already elapsed] format.
*/
public time(): T {
return this.addAndReturn(createTime());
Expand Down

0 comments on commit 3105365

Please sign in to comment.