Fixed a bug that pandora_db.pl had done an unnecessary repeat of 'UPDATE'.
This commit is contained in:
parent
83e29ecb67
commit
5523735e49
|
@ -167,7 +167,7 @@ sub pandora_purgedb ($$) {
|
||||||
$conf->{'_string_purge'} = 7;
|
$conf->{'_string_purge'} = 7;
|
||||||
}
|
}
|
||||||
# Update alert with last_fired older than today - time_threshold
|
# Update alert with last_fired older than today - time_threshold
|
||||||
my @templates = get_db_rows ($dbh, 'SELECT t1.id,t1.time_threshold FROM talert_templates t1 JOIN talert_template_modules t2 ON t1.id = t2.id_alert_template');
|
my @templates = get_db_rows ($dbh, 'SELECT t1.id,t1.time_threshold FROM talert_templates t1 WHERE EXISTS ( SELECT * FROM talert_template_modules t2 WHERE t1.id = t2.id_alert_template );');
|
||||||
foreach my $template(@templates) {
|
foreach my $template(@templates) {
|
||||||
db_do($dbh, 'UPDATE talert_template_modules SET times_fired = 0 WHERE id_alert_template = ? AND times_fired > 0 AND last_fired < (? - ?)',$template->{'id'},time(),$template->{'time_threshold'});
|
db_do($dbh, 'UPDATE talert_template_modules SET times_fired = 0 WHERE id_alert_template = ? AND times_fired > 0 AND last_fired < (? - ?)',$template->{'id'},time(),$template->{'time_threshold'});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue