mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-5447-Referencias-log4x-en-pandora_db' into 'develop'
deleted references to table log4x See merge request artica/pandorafms!3380
This commit is contained in:
commit
d4860bddcc
@ -140,29 +140,6 @@ sub pandora_purgedb ($$) {
|
|||||||
pandora_delete_old_session_data (\%conf, $dbh, $ulimit_timestamp);
|
pandora_delete_old_session_data (\%conf, $dbh, $ulimit_timestamp);
|
||||||
|
|
||||||
# Delete old inventory data
|
# Delete old inventory data
|
||||||
|
|
||||||
#
|
|
||||||
# Now the log4x data
|
|
||||||
#
|
|
||||||
$first_mark = get_db_value_limit ($dbh, 'SELECT utimestamp FROM tagente_datos_log4x ORDER BY utimestamp ASC', 1);
|
|
||||||
if (defined ($first_mark)) {
|
|
||||||
$total_time = $ulimit_timestamp - $first_mark;
|
|
||||||
$purge_steps = int($total_time / $BIG_OPERATION_STEP);
|
|
||||||
if ($purge_steps > 0) {
|
|
||||||
for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){
|
|
||||||
db_do ($dbh, "DELETE FROM tagente_datos_log4x WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark );
|
|
||||||
log_message ('PURGE', "Log4x data deletion progress %$ax\r");
|
|
||||||
# Do a nanosleep here for 0,01 sec
|
|
||||||
usleep (10000);
|
|
||||||
}
|
|
||||||
log_message ('', "\n");
|
|
||||||
} else {
|
|
||||||
log_message ('PURGE', 'No data to purge in tagente_datos_log4x.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
log_message ('PURGE', 'No data in tagente_datos_log4x.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_message ('PURGE', 'days_purge is set to 0. Old data will not be deleted.');
|
log_message ('PURGE', 'days_purge is set to 0. Old data will not be deleted.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user