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

fix(snooze): Add cleanup orphan db entries #8765

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

JohannesGGE
Copy link
Contributor

Fix: #8763

Adds a cleanup call to delete all db entries in the snooze table that should have been unsnoozed 30d ago. We assume that these messages no longer exist in the snoozed mailbox.

$deleteQb->delete($this->getTableName())
->where($deleteQb->expr()->lt(
'snoozed_until',
$deleteQb->createNamedParameter(($this->time->getTime() - 2592000), IQueryBuilder::PARAM_INT),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$deleteQb->createNamedParameter(($this->time->getTime() - 2592000), IQueryBuilder::PARAM_INT),
$deleteQb->createNamedParameter(($this->time->getTime() - (30*7*24*3600)), IQueryBuilder::PARAM_INT),

for readability and the de-optimization won't hurt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Removed the 7*, otherwise we would wait 7 months ;)

@JohannesGGE JohannesGGE force-pushed the fix/8763/add-clenup-for-snooze branch from 62e9027 to bd184dd Compare August 17, 2023 09:14
@JohannesGGE JohannesGGE merged commit f687557 into main Aug 17, 2023
27 of 28 checks passed
@JohannesGGE JohannesGGE deleted the fix/8763/add-clenup-for-snooze branch August 17, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snooze: Clean up leftover DB entries
2 participants