summaryrefslogtreecommitdiff
path: root/src/module.c
diff options
context:
space:
mode:
authorzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>2019-12-18 14:49:38 +0800
committerzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>2019-12-18 15:20:36 +0800
commit24044f33560e9c34e73d8ffc493ed7c0b6b95dbc (patch)
treef3d6aca592a2c9231ffd369e9ac5d08c464f34ff /src/module.c
parentb7c78b7651c5458ccf5d95ef5857ec427b927a27 (diff)
downloadredis-24044f33560e9c34e73d8ffc493ed7c0b6b95dbc.tar.gz
add a new SET option KEEPTTL that doesn't remove expire time
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c
index 1fda29625..3bfde5cd4 100644
--- a/src/module.c
+++ b/src/module.c
@@ -2107,7 +2107,7 @@ RedisModuleString *RM_RandomKey(RedisModuleCtx *ctx) {
int RM_StringSet(RedisModuleKey *key, RedisModuleString *str) {
if (!(key->mode & REDISMODULE_WRITE) || key->iter) return REDISMODULE_ERR;
RM_DeleteKey(key);
- setKey(key->db,key->key,str);
+ setKey(key->db,key->key,str,0);
key->value = str;
return REDISMODULE_OK;
}
@@ -2187,7 +2187,7 @@ int RM_StringTruncate(RedisModuleKey *key, size_t newlen) {
if (key->value == NULL) {
/* Empty key: create it with the new size. */
robj *o = createObject(OBJ_STRING,sdsnewlen(NULL, newlen));
- setKey(key->db,key->key,o);
+ setKey(key->db,key->key,o,0);
key->value = o;
decrRefCount(o);
} else {
@@ -3571,7 +3571,7 @@ int RM_ModuleTypeSetValue(RedisModuleKey *key, moduleType *mt, void *value) {
if (!(key->mode & REDISMODULE_WRITE) || key->iter) return REDISMODULE_ERR;
RM_DeleteKey(key);
robj *o = createModuleObject(mt,value);
- setKey(key->db,key->key,o);
+ setKey(key->db,key->key,o,0);
decrRefCount(o);
key->value = o;
return REDISMODULE_OK;