Skip to content

Commit

Permalink
Delete the discovery if on a collector and finished and type = 'colle…
Browse files Browse the repository at this point in the history
…ctor'.
  • Loading branch information
mark-unwin committed Mar 5, 2024
1 parent 93a503c commit 091d1db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Helpers/discoveries_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2165,10 +2165,10 @@ function discovery_check_finished(int $id)
$discoveryLogModel->create($log);
// If we are a collector and the discovery is an instant - delete it locally
$instance = & get_instance();
if (!empty($instance->config->servers) and $instance->config->servers->type === 'collector' and strpos($result[0]->name, 'Instant Discovery') !== false) {
if (!empty($instance->config->servers) and $instance->config->servers->type === 'collector') {
log_message('info', 'Deleting discovery named: ' . $result[0]->name);
$sql = "DELETE FROM `discoveries` WHERE `id` = ?";
$db->query($sql, [$id]);
log_message('info', 'Deleting discovery named: ' . $result[0]->name);
}
}
}
Expand Down

0 comments on commit 091d1db

Please sign in to comment.