Skip to content

Commit cb1c527

Browse files
committed
Fixed command SET.
1 parent 12f93af commit cb1c527

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@litert/redis",
3-
"version": "1.0.0",
3+
"version": "1.0.1-0",
44
"description": "A redis protocol implement for Node.js.",
55
"main": "./lib/index.js",
66
"scripts": {

src/lib/Commands.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
208208
* @see https://redis.io/commands/set
209209
*/
210210
"set": {
211-
prepare: createDefaultPreparer("SET"),
211+
prepare(k: string, v: string | Buffer, ttl?: number): IPrepareResult {
212+
return {
213+
cmd: "SET",
214+
args: ttl ? [k, v, "EX", ttl] : [k, v]
215+
};
216+
},
212217
process: isStringOK
213218
},
214219

0 commit comments

Comments
 (0)