Only process followups if there are any results

This commit is contained in:
f0o
2015-08-27 14:05:47 +01:00
parent 83af24ca34
commit f28103173b
+1 -1
View File
@@ -193,7 +193,7 @@ function RunFollowUp() {
$state = 4;
}
if ($state > 0) {
if ($state > 0 && $n > 0) {
$alert['details']['rule'] = $chk;
if (dbInsert(array('state' => $state, 'device_id' => $alert['device_id'], 'rule_id' => $alert['rule_id'], 'details' => gzcompress(json_encode($alert['details']), 9)), 'alert_log')) {
dbUpdate(array('state' => $state, 'open' => 1, 'alerted' => 1), 'alerts', 'rule_id = ? && device_id = ?', array($alert['rule_id'], $alert['device_id']));