Delete old data that was not exported.

This commit is contained in:
Ramon Novoa 2014-10-07 14:29:19 +02:00
parent aab0934125
commit 3a27b49edd
1 changed files with 15 additions and 0 deletions

View File

@ -82,6 +82,9 @@ sub pandora_purgedb ($$) {
# Delete old numeric data
pandora_delete_old_module_data ($dbh, 'tagente_datos', $ulimit_access_timestamp, $ulimit_timestamp);
# Delete old export data
pandora_delete_old_export_data ($dbh, $ulimit_timestamp);
# Delete extended session data
if (enterprise_load (\%conf) != 0) {
@ -845,6 +848,18 @@ sub pandora_delete_old_module_data {
}
}
##############################################################################
# Delete old export data.
##############################################################################
sub pandora_delete_old_export_data {
my ($dbh, $ulimit_timestamp) = @_;
log_message ('PURGE', "Deleting old export data from tserver_export_data\n");
while(db_do ($dbh, "DELETE FROM tserver_export_data WHERE UNIX_TIMESTAMP(timestamp) < ? LIMIT $SMALL_OPERATION_STEP", $ulimit_timestamp) ne '0E0') {
usleep (10000);
};
}
###############################################################################
# Main
###############################################################################