Added more cron tasks.

This commit is contained in:
flash 2018-07-17 19:55:28 +02:00
parent c32525d489
commit a41f7d64c7

View file

@ -75,6 +75,24 @@ if (PHP_SAPI === 'cli') {
AND `ur`.`user_id` = u.`user_id`
)
');
// Deletes expired sessions
Database::exec('
DELETE FROM `msz_sessions`
WHERE `expires_on` < NOW()
');
// Cleans up the login history table
Database::exec('
DELETE FROM `msz_login_attempts`
WHERE `created_at` < NOW() - INTERVAL 1 YEAR
');
// Cleans up the audit log table
Database::exec('
DELETE FROM `msz_audit_log`
WHERE `log_created` < NOW() - INTERVAL 1 YEAR
');
break;
case 'migrate':