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
71c2b467
Commit
71c2b467
authored
Dec 15, 2009
by
antirez
Browse files
debug loadaof implemented in order to add more consistency tests in test-redis.tcl
parent
e054afda
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
71c2b467
...
@@ -6116,6 +6116,14 @@ static void debugCommand(redisClient *c) {
...
@@ -6116,6 +6116,14 @@ static void debugCommand(redisClient *c) {
}
}
redisLog
(
REDIS_WARNING
,
"DB reloaded by DEBUG RELOAD"
);
redisLog
(
REDIS_WARNING
,
"DB reloaded by DEBUG RELOAD"
);
addReply
(
c
,
shared
.
ok
);
addReply
(
c
,
shared
.
ok
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"loadaof"
))
{
emptyDb
();
if
(
loadAppendOnlyFile
(
server
.
appendfilename
)
!=
REDIS_OK
)
{
addReply
(
c
,
shared
.
err
);
return
;
}
redisLog
(
REDIS_WARNING
,
"Append Only File loaded by DEBUG LOADAOF"
);
addReply
(
c
,
shared
.
ok
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"object"
)
&&
c
->
argc
==
3
)
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"object"
)
&&
c
->
argc
==
3
)
{
dictEntry
*
de
=
dictFind
(
c
->
db
->
dict
,
c
->
argv
[
2
]);
dictEntry
*
de
=
dictFind
(
c
->
db
->
dict
,
c
->
argv
[
2
]);
robj
*
key
,
*
val
;
robj
*
key
,
*
val
;
...
...
test-redis.tcl
View file @
71c2b467
...
@@ -1394,6 +1394,16 @@ proc main {server port} {
...
@@ -1394,6 +1394,16 @@ proc main {server port} {
}
{
1
}
}
{
1
}
}
}
test
{
EXPIRES after a reload
}
{
$r flushdb
$r set x 10
$r expire x 1000
$r save
$r debug reload
set ttl
[
$r
ttl x
]
expr
{
$ttl
> 900 && $ttl <= 1000
}
}
{
1
}
# Leave the user with a clean DB before to exit
# Leave the user with a clean DB before to exit
test
{
FLUSHDB
}
{
test
{
FLUSHDB
}
{
set aux
{}
set aux
{}
...
...
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