Cleaning up unused chat data
In order to minimize the amount of storage space that Chat data consumes, it incorporates a set of scheduled tasks, which delete old and inactive records on a regular basis.
Delete old chat records
This scheduled task deletes chat messages, rooms and anonymous users which haven’t logged any activity for the amount of time specified in settings. The age of the data that is to be deleted can be specified in Settings -> Community -> Chat -> Days of inactivity needed to delete chat records.
The order of performed deleting operations is as follows:
- Delete messages - messages that were sent earlier than the specified amount of time.
- Delete rooms - rooms that meet all of the following criteria will be deleted:
- is private
- contains no messages
- was created earlier than the specified amount of time
- doesn’t contain any registered (non-anonymous) user that has elevated room permissions
- doesn’t contain any anonymous user that has been on-line in the room during specified amount of time
- Delete users - users meeting all of the following conditions will be deleted:
- haven’t sent any message in the specified amount of time
- haven’t been on-line in the specified amount of time
Clean chat on-line users
This scheduled task removes anonymous users who stopped sending pings to the server without going off-line (e.g. their connection was interrupted or they simply closed the browser window).
Clean chat rooms scheduled to delete
When you delete a room, it becomes disabled and scheduled to be deleted instead of being physically deleted from the database right away.
This scheduled task is by default executed once a day to delete the rooms marked for deletion.
This behavior ensures that users present in such room have a chance to get notified about the fact that the room they are in is getting deleted.