MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rewriteConfigSlaveofOption

Function rewriteConfigSlaveofOption

app/redis-6.2.6/src/config.c:1445–1458  ·  view source on GitHub ↗

Rewrite the slaveof option. */

Source from the content-addressed store, hash-verified

1443
1444/* Rewrite the slaveof option. */
1445void rewriteConfigSlaveofOption(struct rewriteConfigState *state, char *option) {
1446 sds line;
1447
1448 /* If this is a master, we want all the slaveof config options
1449 * in the file to be removed. Note that if this is a cluster instance
1450 * we don't want a slaveof directive inside redis.conf. */
1451 if (server.cluster_enabled || server.masterhost == NULL) {
1452 rewriteConfigMarkAsProcessed(state,option);
1453 return;
1454 }
1455 line = sdscatprintf(sdsempty(),"%s %s %d", option,
1456 server.masterhost, server.masterport);
1457 rewriteConfigRewriteLine(state,option,line,1);
1458}
1459
1460/* Rewrite the notify-keyspace-events option. */
1461void rewriteConfigNotifykeyspaceeventsOption(struct rewriteConfigState *state) {

Callers 1

rewriteConfigFunction · 0.85

Calls 4

sdscatprintfFunction · 0.85
sdsemptyFunction · 0.85
rewriteConfigRewriteLineFunction · 0.85

Tested by

no test coverage detected