Merge pull request #614 from wrongecho/notif-cleanup

Automatically cleanup dismissed notifications after 90 days
This commit is contained in:
Johnny 2023-02-11 18:53:51 -05:00 committed by GitHub
commit 548bfc0012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -79,6 +79,9 @@ while($row = mysqli_fetch_array($sql_companies)){
// Invalidate any password reset links
mysqli_query($mysqli, "UPDATE contacts SET contact_password_reset_token = NULL WHERE contact_archived_at IS NULL");
// Clean-up old dismissed notifications
mysqli_query($mysqli, "DELETE FROM notifications WHERE notification_dismissed_at < CURDATE() - INTERVAL 90 DAY");
/*
@ -130,9 +133,9 @@ while($row = mysqli_fetch_array($sql_companies)){
$sql = mysqli_query(
$mysqli,
"SELECT * FROM domains
LEFT JOIN clients ON domain_client_id = client_id
WHERE domain_expire = CURDATE() + INTERVAL $day DAY
AND domains.company_id = $company_id"
LEFT JOIN clients ON domain_client_id = client_id
WHERE domain_expire = CURDATE() + INTERVAL $day DAY
AND domains.company_id = $company_id"
);
while($row = mysqli_fetch_array($sql)){