Delete validated events from tmetaconsole_event_history.
This commit is contained in:
parent
dee1e92efe
commit
3be96054c0
|
@ -213,6 +213,20 @@ sub pandora_purgedb ($$) {
|
||||||
usleep (10000);
|
usleep (10000);
|
||||||
}
|
}
|
||||||
log_message ('', "\n");
|
log_message ('', "\n");
|
||||||
|
|
||||||
|
log_message ('PURGE', "Deleting validated events from tmetaconsole_event_history.", '');
|
||||||
|
$events_to_delete = get_db_value ($dbh, "SELECT COUNT(*) FROM tmetaconsole_event_history WHERE estado = 1");
|
||||||
|
while($events_to_delete > 0) {
|
||||||
|
db_do($dbh, "DELETE FROM tmetaconsole_event_history WHERE estado = 1 LIMIT ?", $BIG_OPERATION_STEP);
|
||||||
|
$events_to_delete = $events_to_delete - $BIG_OPERATION_STEP;
|
||||||
|
|
||||||
|
# Mark the progress
|
||||||
|
log_message ('', ".");
|
||||||
|
|
||||||
|
# Do not overload the MySQL server
|
||||||
|
usleep (10000);
|
||||||
|
}
|
||||||
|
log_message ('', "\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_message ('PURGE', 'event_purge is set to 0. Old events will not be deleted.');
|
log_message ('PURGE', 'event_purge is set to 0. Old events will not be deleted.');
|
||||||
|
|
Loading…
Reference in New Issue