MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / sentinelPublishCommand

Function sentinelPublishCommand

src/sentinel.cpp:4168–4175  ·  view source on GitHub ↗

Our fake PUBLISH command: it is actually useful only to receive hello messages * from the other sentinel instances, and publishing to a channel other than * SENTINEL_HELLO_CHANNEL is forbidden. * * Because we have a Sentinel PUBLISH, the code to send hello messages is the same * for all the three kind of instances: masters, slaves, sentinels. */

Source from the content-addressed store, hash-verified

4166 * Because we have a Sentinel PUBLISH, the code to send hello messages is the same
4167 * for all the three kind of instances: masters, slaves, sentinels. */
4168void sentinelPublishCommand(client *c) {
4169 if (strcmp(szFromObj(c->argv[1]),SENTINEL_HELLO_CHANNEL)) {
4170 addReplyError(c, "Only HELLO messages are accepted by Sentinel instances.");
4171 return;
4172 }
4173 sentinelProcessHelloMessage(szFromObj(c->argv[2]),sdslen(szFromObj(c->argv[2])));
4174 addReplyLongLong(c,1);
4175}
4176
4177/* ===================== SENTINEL availability checks ======================= */
4178

Callers

nothing calls this directly

Calls 5

szFromObjFunction · 0.85
addReplyErrorFunction · 0.85
sdslenFunction · 0.85
addReplyLongLongFunction · 0.85

Tested by

no test coverage detected