-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented deletion of notices at expiry date #107
base: main
Are you sure you want to change the base?
Conversation
tools/docker-dev/sql/bootstrap.sql
Outdated
@@ -156,7 +157,7 @@ CREATE TABLE `notices` ( | |||
|
|||
INSERT INTO `notices` (`id`, `date`, `title`, `message`) VALUES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be an 'expiry' here?
tools/docker-dev/unity-web-portal
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this new directory meant to be here?
@@ -17,6 +17,10 @@ | |||
|
|||
$notices = $SQL->getNotices(); | |||
foreach ($notices as $notice) { | |||
if ($notice["expiry"] < date('Y-m-d')) { | |||
$SQL->deleteNotice($notice["id"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing the deletion here causes a race condition if two page loads happen at the same time and so try to delete the same items. This will cause it to throw an exception.
#89