From 7c3cbb7e5833679049c7c0b8f45c546ce118258b Mon Sep 17 00:00:00 2001 From: NinaHerrmann Date: Thu, 13 Jun 2024 16:01:02 +0200 Subject: [PATCH] added deletion after one year in the email notified table --- classes/task/lifecycle_cleanup_task.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/task/lifecycle_cleanup_task.php b/classes/task/lifecycle_cleanup_task.php index 19455eaf..09a96e61 100644 --- a/classes/task/lifecycle_cleanup_task.php +++ b/classes/task/lifecycle_cleanup_task.php @@ -48,7 +48,9 @@ public function get_name() { public function execute() { global $DB; $twomonthago = time() - 60 * 24 * 60 * 60; + $oneyearago = time() - 365 * 24 * 60 * 60; $DB->delete_records_select('tool_lifecycle_delayed', 'delayeduntil <= :time', ['time' => $twomonthago]); $DB->delete_records_select('tool_lifecycle_delayed_workf', 'delayeduntil <= :time', ['time' => $twomonthago]); + $DB->delete_records_select('lifecyclestep_email_notified', 'timemailsent <= :time', ['time' => $oneyearago]); } }