mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +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);
|
||||
|
||||
if (empty($result)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if ($rule->object_type === 'service') {
|
||||
$pattern = $rule->getSourceKeyPattern();
|
||||
$columns = SyncUtils::getRootVariables(
|
||||
@ -78,10 +82,10 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
return array_combine($result, $result);
|
||||
} else {
|
||||
if (empty($result)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
return array_combine($result, $result);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user