Rewrite the slaveof option. */
| 1694 | |
| 1695 | /* Rewrite the slaveof option. */ |
| 1696 | void rewriteConfigSlaveofOption(struct rewriteConfigState *state, const char *option) { |
| 1697 | /* If this is a master, we want all the slaveof config options |
| 1698 | * in the file to be removed. Note that if this is a cluster instance |
| 1699 | * we don't want a slaveof directive inside keydb.conf. */ |
| 1700 | if (g_pserver->cluster_enabled || listLength(g_pserver->masters) == 0) { |
| 1701 | rewriteConfigMarkAsProcessed(state,option); |
| 1702 | return; |
| 1703 | } |
| 1704 | |
| 1705 | listIter li; |
| 1706 | listNode *ln; |
| 1707 | listRewind(g_pserver->masters, &li); |
| 1708 | while ((ln = listNext(&li))) |
| 1709 | { |
| 1710 | struct redisMaster *mi = (struct redisMaster*)listNodeValue(ln); |
| 1711 | sds line; |
| 1712 | |
| 1713 | line = sdscatprintf(sdsempty(),"%s %s %d", option, |
| 1714 | mi->masterhost, mi->masterport); |
| 1715 | rewriteConfigRewriteLine(state,option,line,1); |
| 1716 | } |
| 1717 | } |
| 1718 | |
| 1719 | /* Rewrite the notify-keyspace-events option. */ |
| 1720 | void rewriteConfigNotifykeyspaceeventsOption(struct rewriteConfigState *state) { |
no test coverage detected