mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-64883 mod_chat: Fix SQL in cron
This commit is contained in:
parent
9f909b1c75
commit
771a8c3c95
@ -57,8 +57,8 @@ class cron_task extends \core\task\scheduled_task {
|
||||
$subselect = "SELECT c.keepdays
|
||||
FROM {chat} c
|
||||
WHERE c.id = {chat_messages}.chatid";
|
||||
$DB->delete_records_select('chat_messages', "($subselect) > 0 AND timestamp < ?",
|
||||
[$timenow - ($subselect) * DAYSECS]);
|
||||
$DB->delete_records_select('chat_messages', "($subselect) > 0 AND timestamp < (? - ($subselect) * ?)",
|
||||
[$timenow, DAYSECS]);
|
||||
|
||||
$DB->delete_records_select('chat_messages_current', "timestamp < ?", [$timenow - 8 * HOURSECS]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user