Skip to content

Commit

Permalink
added deletion after one year in the email notified table
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaHerrmann committed Jun 13, 2024
1 parent 364361a commit 7c3cbb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classes/task/lifecycle_cleanup_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}

0 comments on commit 7c3cbb7

Please sign in to comment.