mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
ImportRunBasedPurgeStrategy: do not fetch no rows
This commit is contained in:
parent
15acbb5290
commit
e58c31ab63
@ -66,6 +66,10 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
|
|||||||
|
|
||||||
$result = $db->fetchCol($query);
|
$result = $db->fetchCol($query);
|
||||||
|
|
||||||
|
if (empty($result)) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
if ($rule->object_type === 'service') {
|
if ($rule->object_type === 'service') {
|
||||||
$pattern = $rule->getSourceKeyPattern();
|
$pattern = $rule->getSourceKeyPattern();
|
||||||
$columns = SyncUtils::getRootVariables(
|
$columns = SyncUtils::getRootVariables(
|
||||||
@ -78,10 +82,10 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result) {
|
if (empty($result)) {
|
||||||
return array_combine($result, $result);
|
|
||||||
} else {
|
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return array_combine($result, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user