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
9e5bef38
Commit
9e5bef38
authored
Jul 24, 2012
by
antirez
Browse files
Sentinel: reset pending_commands in a more generic way.
parent
a23a5b6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
9e5bef38
...
...
@@ -765,7 +765,6 @@ void sentinelResetMaster(sentinelRedisInstance *ri, int flags) {
ri
->
sentinels
=
dictCreate
(
&
instancesDictType
,
NULL
);
if
(
ri
->
cc
)
sentinelKillLink
(
ri
,
ri
->
cc
);
if
(
ri
->
pc
)
sentinelKillLink
(
ri
,
ri
->
pc
);
ri
->
pending_commands
=
0
;
ri
->
flags
&=
SRI_MASTER
|
SRI_CAN_FAILOVER
|
SRI_DISCONNECTED
;
if
(
ri
->
leader
)
{
sdsfree
(
ri
->
leader
);
...
...
@@ -891,7 +890,10 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
/* Completely disconnect an hiredis link from an instance. */
void
sentinelKillLink
(
sentinelRedisInstance
*
ri
,
redisAsyncContext
*
c
)
{
if
(
ri
->
cc
==
c
)
ri
->
cc
=
NULL
;
if
(
ri
->
cc
==
c
)
{
ri
->
cc
=
NULL
;
ri
->
pending_commands
=
0
;
}
if
(
ri
->
pc
==
c
)
ri
->
pc
=
NULL
;
c
->
data
=
NULL
;
ri
->
flags
|=
SRI_DISCONNECTED
;
...
...
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