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]); } }