Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Shaswat975
Copy link
Collaborator

#89

@Shaswat975 Shaswat975 requested a review from hakasapl May 31, 2024 14:06
@@ -156,7 +157,7 @@ CREATE TABLE `notices` (

INSERT INTO `notices` (`id`, `date`, `title`, `message`) VALUES

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?

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"]);
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants