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

Function sentinelGenerateInitialMonitorEvents

src/sentinel.cpp:757–767  ·  view source on GitHub ↗

This function is called only at startup and is used to generate a * +monitor event for every configured master. The same events are also * generated when a master to monitor is added at runtime via the * SENTINEL MONITOR command. */

Source from the content-addressed store, hash-verified

755 * generated when a master to monitor is added at runtime via the
756 * SENTINEL MONITOR command. */
757void sentinelGenerateInitialMonitorEvents(void) {
758 dictIterator *di;
759 dictEntry *de;
760
761 di = dictGetIterator(sentinel.masters);
762 while((de = dictNext(di)) != NULL) {
763 sentinelRedisInstance *ri = (sentinelRedisInstance*)dictGetVal(de);
764 sentinelEvent(LL_WARNING,"+monitor",ri,"%@ quorum %d",ri->quorum);
765 }
766 dictReleaseIterator(di);
767}
768
769/* ============================ script execution ============================ */
770

Callers 1

sentinelIsRunningFunction · 0.85

Calls 4

sentinelEventFunction · 0.85
dictGetIteratorFunction · 0.70
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected