Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
802e8373
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
802e8373
编写于
10月 30, 2009
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
EXPIREAT implemented, will be useful for the append-only mode
上级
fa4c0aba
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
4 deletion
+16
-4
TODO
TODO
+1
-0
redis-cli.c
redis-cli.c
+1
-0
redis.c
redis.c
+14
-4
未找到文件。
TODO
浏览文件 @
802e8373
...
@@ -6,6 +6,7 @@ VERSION 1.1 TODO
...
@@ -6,6 +6,7 @@ VERSION 1.1 TODO
* Add all the missing symbols for the statis functions into the table. This backtrace on segfault is indeed *very* useful.
* Add all the missing symbols for the statis functions into the table. This backtrace on segfault is indeed *very* useful.
* Use strcoll() to compare objects in sorted sets, like it already happens for SORT.
* Use strcoll() to compare objects in sorted sets, like it already happens for SORT.
* LMOVE, as discussed in the Redis group.
* LMOVE, as discussed in the Redis group.
* EXPIRE and EXPIREAT tests.
VERSION 1.2 TODO
VERSION 1.2 TODO
...
...
redis-cli.c
浏览文件 @
802e8373
...
@@ -120,6 +120,7 @@ static struct redisCommand cmdTable[] = {
...
@@ -120,6 +120,7 @@ static struct redisCommand cmdTable[] = {
{
"info"
,
1
,
REDIS_CMD_INLINE
},
{
"info"
,
1
,
REDIS_CMD_INLINE
},
{
"mget"
,
-
2
,
REDIS_CMD_INLINE
},
{
"mget"
,
-
2
,
REDIS_CMD_INLINE
},
{
"expire"
,
3
,
REDIS_CMD_INLINE
},
{
"expire"
,
3
,
REDIS_CMD_INLINE
},
{
"expireat"
,
3
,
REDIS_CMD_INLINE
},
{
"ttl"
,
2
,
REDIS_CMD_INLINE
},
{
"ttl"
,
2
,
REDIS_CMD_INLINE
},
{
"slaveof"
,
3
,
REDIS_CMD_INLINE
},
{
"slaveof"
,
3
,
REDIS_CMD_INLINE
},
{
"debug"
,
-
2
,
REDIS_CMD_INLINE
},
{
"debug"
,
-
2
,
REDIS_CMD_INLINE
},
...
...
redis.c
浏览文件 @
802e8373
...
@@ -440,6 +440,7 @@ static void infoCommand(redisClient *c);
...
@@ -440,6 +440,7 @@ static void infoCommand(redisClient *c);
static
void
mgetCommand
(
redisClient
*
c
);
static
void
mgetCommand
(
redisClient
*
c
);
static
void
monitorCommand
(
redisClient
*
c
);
static
void
monitorCommand
(
redisClient
*
c
);
static
void
expireCommand
(
redisClient
*
c
);
static
void
expireCommand
(
redisClient
*
c
);
static
void
expireatCommand
(
redisClient
*
c
);
static
void
getsetCommand
(
redisClient
*
c
);
static
void
getsetCommand
(
redisClient
*
c
);
static
void
ttlCommand
(
redisClient
*
c
);
static
void
ttlCommand
(
redisClient
*
c
);
static
void
slaveofCommand
(
redisClient
*
c
);
static
void
slaveofCommand
(
redisClient
*
c
);
...
@@ -511,6 +512,7 @@ static struct redisCommand cmdTable[] = {
...
@@ -511,6 +512,7 @@ static struct redisCommand cmdTable[] = {
{
"rename"
,
renameCommand
,
3
,
REDIS_CMD_INLINE
},
{
"rename"
,
renameCommand
,
3
,
REDIS_CMD_INLINE
},
{
"renamenx"
,
renamenxCommand
,
3
,
REDIS_CMD_INLINE
},
{
"renamenx"
,
renamenxCommand
,
3
,
REDIS_CMD_INLINE
},
{
"expire"
,
expireCommand
,
3
,
REDIS_CMD_INLINE
},
{
"expire"
,
expireCommand
,
3
,
REDIS_CMD_INLINE
},
{
"expireat"
,
expireatCommand
,
3
,
REDIS_CMD_INLINE
},
{
"keys"
,
keysCommand
,
2
,
REDIS_CMD_INLINE
},
{
"keys"
,
keysCommand
,
2
,
REDIS_CMD_INLINE
},
{
"dbsize"
,
dbsizeCommand
,
1
,
REDIS_CMD_INLINE
},
{
"dbsize"
,
dbsizeCommand
,
1
,
REDIS_CMD_INLINE
},
{
"auth"
,
authCommand
,
2
,
REDIS_CMD_INLINE
},
{
"auth"
,
authCommand
,
2
,
REDIS_CMD_INLINE
},
...
@@ -4736,11 +4738,10 @@ static int deleteIfVolatile(redisDb *db, robj *key) {
...
@@ -4736,11 +4738,10 @@ static int deleteIfVolatile(redisDb *db, robj *key) {
return
dictDelete
(
db
->
dict
,
key
)
==
DICT_OK
;
return
dictDelete
(
db
->
dict
,
key
)
==
DICT_OK
;
}
}
static
void
expire
Command
(
redisClient
*
c
)
{
static
void
expire
GenericCommand
(
redisClient
*
c
,
robj
*
key
,
time_t
seconds
)
{
dictEntry
*
de
;
dictEntry
*
de
;
int
seconds
=
atoi
(
c
->
argv
[
2
]
->
ptr
);
de
=
dictFind
(
c
->
db
->
dict
,
c
->
argv
[
1
]
);
de
=
dictFind
(
c
->
db
->
dict
,
key
);
if
(
de
==
NULL
)
{
if
(
de
==
NULL
)
{
addReply
(
c
,
shared
.
czero
);
addReply
(
c
,
shared
.
czero
);
return
;
return
;
...
@@ -4750,7 +4751,7 @@ static void expireCommand(redisClient *c) {
...
@@ -4750,7 +4751,7 @@ static void expireCommand(redisClient *c) {
return
;
return
;
}
else
{
}
else
{
time_t
when
=
time
(
NULL
)
+
seconds
;
time_t
when
=
time
(
NULL
)
+
seconds
;
if
(
setExpire
(
c
->
db
,
c
->
argv
[
1
]
,
when
))
{
if
(
setExpire
(
c
->
db
,
key
,
when
))
{
addReply
(
c
,
shared
.
cone
);
addReply
(
c
,
shared
.
cone
);
server
.
dirty
++
;
server
.
dirty
++
;
}
else
{
}
else
{
...
@@ -4760,6 +4761,14 @@ static void expireCommand(redisClient *c) {
...
@@ -4760,6 +4761,14 @@ static void expireCommand(redisClient *c) {
}
}
}
}
static
void
expireCommand
(
redisClient
*
c
)
{
expireGenericCommand
(
c
,
c
->
argv
[
1
],
strtol
(
c
->
argv
[
2
]
->
ptr
,
NULL
,
10
));
}
static
void
expireatCommand
(
redisClient
*
c
)
{
expireGenericCommand
(
c
,
c
->
argv
[
1
],
strtol
(
c
->
argv
[
2
]
->
ptr
,
NULL
,
10
)
-
time
(
NULL
));
}
static
void
ttlCommand
(
redisClient
*
c
)
{
static
void
ttlCommand
(
redisClient
*
c
)
{
time_t
expire
;
time_t
expire
;
int
ttl
=
-
1
;
int
ttl
=
-
1
;
...
@@ -5312,6 +5321,7 @@ static struct redisFunctionSym symsTable[] = {
...
@@ -5312,6 +5321,7 @@ static struct redisFunctionSym symsTable[] = {
{
"mgetCommand"
,
(
unsigned
long
)
mgetCommand
},
{
"mgetCommand"
,
(
unsigned
long
)
mgetCommand
},
{
"monitorCommand"
,
(
unsigned
long
)
monitorCommand
},
{
"monitorCommand"
,
(
unsigned
long
)
monitorCommand
},
{
"expireCommand"
,
(
unsigned
long
)
expireCommand
},
{
"expireCommand"
,
(
unsigned
long
)
expireCommand
},
{
"expireatCommand"
,
(
unsigned
long
)
expireatCommand
},
{
"getsetCommand"
,
(
unsigned
long
)
getsetCommand
},
{
"getsetCommand"
,
(
unsigned
long
)
getsetCommand
},
{
"ttlCommand"
,
(
unsigned
long
)
ttlCommand
},
{
"ttlCommand"
,
(
unsigned
long
)
ttlCommand
},
{
"slaveofCommand"
,
(
unsigned
long
)
slaveofCommand
},
{
"slaveofCommand"
,
(
unsigned
long
)
slaveofCommand
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录