This function is used for queuing sentinel configuration, the main * purpose of this function is to delay parsing the sentinel config option * in order to avoid the order dependent issue from the config. */
| 1811 | * purpose of this function is to delay parsing the sentinel config option |
| 1812 | * in order to avoid the order dependent issue from the config. */ |
| 1813 | void queueSentinelConfig(sds *argv, int argc, int linenum, sds line) { |
| 1814 | int i; |
| 1815 | struct sentinelLoadQueueEntry *entry; |
| 1816 | |
| 1817 | /* initialize sentinel_config for the first call */ |
| 1818 | if (server.sentinel_config == NULL) initializeSentinelConfig(); |
| 1819 | |
| 1820 | entry = zmalloc(sizeof(struct sentinelLoadQueueEntry)); |
| 1821 | entry->argv = zmalloc(sizeof(char*)*argc); |
| 1822 | entry->argc = argc; |
| 1823 | entry->linenum = linenum; |
| 1824 | entry->line = sdsdup(line); |
| 1825 | for (i = 0; i < argc; i++) { |
| 1826 | entry->argv[i] = sdsdup(argv[i]); |
| 1827 | } |
| 1828 | /* Separate config lines with pre monitor config, monitor config and |
| 1829 | * post monitor config, in order to parsing config dependencies |
| 1830 | * correctly. */ |
| 1831 | if (!strcasecmp(argv[0],"monitor")) { |
| 1832 | listAddNodeTail(server.sentinel_config->monitor_cfg,entry); |
| 1833 | } else if (searchPreMonitorCfgName(argv[0])) { |
| 1834 | listAddNodeTail(server.sentinel_config->pre_monitor_cfg,entry); |
| 1835 | } else{ |
| 1836 | listAddNodeTail(server.sentinel_config->post_monitor_cfg,entry); |
| 1837 | } |
| 1838 | } |
| 1839 | |
| 1840 | /* This function is used for loading the sentinel configuration from |
| 1841 | * pre_monitor_cfg, monitor_cfg and post_monitor_cfg list */ |
no test coverage detected