internal: Replace monitor rule when disabling head. (#6136)
Closes #5978
This commit is contained in:
parent
255272ea18
commit
eea0a6a704
3 changed files with 21 additions and 1 deletions
|
|
@ -1264,6 +1264,18 @@ void CConfigManager::appendMonitorRule(const SMonitorRule& r) {
|
|||
m_dMonitorRules.emplace_back(r);
|
||||
}
|
||||
|
||||
bool CConfigManager::replaceMonitorRule(const SMonitorRule& newrule) {
|
||||
// Looks for an existing monitor rule (compared by name).
|
||||
// If the rule exists, it is replaced with the input rule.
|
||||
for (auto& r : m_dMonitorRules) {
|
||||
if (r.name == newrule.name) {
|
||||
r = newrule;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CConfigManager::performMonitorReload() {
|
||||
|
||||
bool overAgain = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue