Pandora db delete /tmp/cron-session-cookies file

This commit is contained in:
Calvo 2023-02-06 11:58:50 +01:00
parent cc3d826117
commit 3e45b548b6
1 changed files with 7 additions and 1 deletions

View File

@ -1067,12 +1067,18 @@ sub pandora_delete_old_session_data {
$ulimit_timestamp = time() - $session_timeout;
log_message ('PURGE', "Deleting old session data from tsessions_php\n");
log_message ('PURGE', "Deleting old session data from tsessions_php");
while(db_delete_limit ($dbh, 'tsessions_php', 'last_active < ?', $SMALL_OPERATION_STEP, $ulimit_timestamp) ne '0E0') {
usleep (10000);
};
db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'");
# Delete cron cookies file
my $cookie_file = '/tmp/cron-session-cookies';
log_message ('PURGE', "Deleting cron session file");
unlink($cookie_file) or die log_message ('PURGE', "Could not delete session file");
}
###############################################################################