Added more cron tasks.
This commit is contained in:
parent
c32525d489
commit
a41f7d64c7
1 changed files with 18 additions and 0 deletions
18
misuzu.php
18
misuzu.php
|
@ -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':
|
||||
|
|
Loading…
Reference in a new issue