This commit is contained in:
Vanessa Gil 2015-04-17 14:54:17 +02:00
parent e93da42f5f
commit 1c3f0275b1
1 changed files with 15 additions and 0 deletions

View File

@ -99,6 +99,9 @@ sub pandora_purgedb ($$) {
# Delete old export data
pandora_delete_old_export_data ($dbh, $ulimit_timestamp);
# Delete sessions data
pandora_delete_old_session_data ($dbh, $ulimit_timestamp);
# Delete old inventory data
if (enterprise_load (\%conf) != 0) {
@ -949,6 +952,18 @@ sub pandora_delete_old_export_data {
};
}
##############################################################################
# Delete old session data.
##############################################################################
sub pandora_delete_old_session_data {
my ($dbh, $ulimit_timestamp) = @_;
log_message ('PURGE', "Deleting old session data from tsessions_php\n");
while(db_do ($dbh, "DELETE FROM tsessions_php WHERE last_active < ? LIMIT $SMALL_OPERATION_STEP", $ulimit_timestamp) ne '0E0') {
usleep (10000);
};
}
###############################################################################
# Main
###############################################################################