Sentinel: config-rewrite unique ID just one time

This commit is contained in:
antirez 2015-05-14 17:44:52 +02:00
parent f9e942d4ae
commit 4dee18cb66

View File

@ -1646,16 +1646,16 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
dictEntry *de; dictEntry *de;
sds line; sds line;
/* sentinel unique ID. */
line = sdscatprintf(sdsempty(), "sentinel myid %s", sentinel.myid);
rewriteConfigRewriteLine(state,"sentinel",line,1);
/* For every master emit a "sentinel monitor" config entry. */ /* For every master emit a "sentinel monitor" config entry. */
di = dictGetIterator(sentinel.masters); di = dictGetIterator(sentinel.masters);
while((de = dictNext(di)) != NULL) { while((de = dictNext(di)) != NULL) {
sentinelRedisInstance *master, *ri; sentinelRedisInstance *master, *ri;
sentinelAddr *master_addr; sentinelAddr *master_addr;
/* sentinel unique ID. */
line = sdscatprintf(sdsempty(), "sentinel myid %s", sentinel.myid);
rewriteConfigRewriteLine(state,"sentinel",line,1);
/* sentinel monitor */ /* sentinel monitor */
master = dictGetVal(de); master = dictGetVal(de);
master_addr = sentinelGetCurrentMasterAddress(master); master_addr = sentinelGetCurrentMasterAddress(master);