mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9106 from Icinga/feature/avoid-copy-in-downtimes-timer
Downtime::DowntimesExpireTimerHandler: don't copy vector
This commit is contained in:
commit
978a72afa2
|
@ -482,13 +482,7 @@ void Downtime::DowntimesStartTimerHandler()
|
||||||
|
|
||||||
void Downtime::DowntimesExpireTimerHandler()
|
void Downtime::DowntimesExpireTimerHandler()
|
||||||
{
|
{
|
||||||
std::vector<Downtime::Ptr> downtimes;
|
|
||||||
|
|
||||||
for (const Downtime::Ptr& downtime : ConfigType::GetObjectsByType<Downtime>()) {
|
for (const Downtime::Ptr& downtime : ConfigType::GetObjectsByType<Downtime>()) {
|
||||||
downtimes.push_back(downtime);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const Downtime::Ptr& downtime : downtimes) {
|
|
||||||
/* Only remove downtimes which are activated after daemon start. */
|
/* Only remove downtimes which are activated after daemon start. */
|
||||||
if (downtime->IsActive() && (downtime->IsExpired() || !downtime->HasValidConfigOwner()))
|
if (downtime->IsActive() && (downtime->IsExpired() || !downtime->HasValidConfigOwner()))
|
||||||
RemoveDowntime(downtime->GetName(), false, false, true);
|
RemoveDowntime(downtime->GetName(), false, false, true);
|
||||||
|
|
Loading…
Reference in New Issue