From 3a27b49edd3180d064e6f896d86a86353f5bc447 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 7 Oct 2014 14:29:19 +0200 Subject: [PATCH] Delete old data that was not exported. --- pandora_server/util/pandora_db.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4c4edadc3e..4fe43b7a70 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -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 ###############################################################################