Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
15db4aa0
Commit
15db4aa0
authored
Mar 04, 2011
by
antirez
Browse files
TTL command fixed to work reliably with diskstore
parent
8b108ed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
15db4aa0
...
@@ -592,6 +592,7 @@ void expireatCommand(redisClient *c) {
...
@@ -592,6 +592,7 @@ void expireatCommand(redisClient *c) {
void
ttlCommand
(
redisClient
*
c
)
{
void
ttlCommand
(
redisClient
*
c
)
{
time_t
expire
,
ttl
=
-
1
;
time_t
expire
,
ttl
=
-
1
;
if
(
server
.
ds_enabled
)
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]);
expire
=
getExpire
(
c
->
db
,
c
->
argv
[
1
]);
expire
=
getExpire
(
c
->
db
,
c
->
argv
[
1
]);
if
(
expire
!=
-
1
)
{
if
(
expire
!=
-
1
)
{
ttl
=
(
expire
-
time
(
NULL
));
ttl
=
(
expire
-
time
(
NULL
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment