Automatically delete old notifications from notification_internal_activity

Bug #645744 reported by Richard Mansfield
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Eugene

Bug Description

The notification_internal_activity table can get pretty big after a while because we rely on users to delete their own notifications.

Some of the more useless notifications could be removed periodically to make upgrades on that table a bit less painful. See http://mahara.org/interaction/forum/topic.php?id=2287

The worst offenders that would be safe to delete are forum post, view access, watchlist, and institution message notifications, perhaps just when they're marked as read, and are a few months old.

Most of the 'maharamessage' and ones could go too when they're old, but because that type is a bit of a dumping ground for random system notifications, we'd have to be a bit careful about it.

Others such as the admin notifications and user messages, should just hang around forever because they're not stored anywhere else.

Revision history for this message
Eugene (eugenev) wrote :

Richard - I have written a patch that should get us going on this one ;).
I have added a core cronjob function that will delete stale (read and older than 21days) 'viewaccess', 'institutionmessage', 'watchlist', 'feedback' and 'newpost' notifications.

See the patch and let me know what you think.

Revision history for this message
Eugene (eugenev) wrote :

Richard - Please see the latest attached patch regarding this issue ;)

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Looks good to me.

Eugene (eugenev)
Changed in mahara:
assignee: nobody → Eugene (eugene-catalyst)
status: New → Fix Committed
Changed in mahara:
milestone: none → 1.4.0
Changed in mahara:
status: Fix Committed → Fix Released
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.