LOC-11 Implementing auto-closure of rooms
author B Tasker
()
committer B Tasker
()
commit faba89833cac58ddc09c0252464b8e89c3bf5b5d
tree 319ee0a7fb46378fdf5b8d61d43ad251e48233e1
parent ef39ae2d62e3d8de4bd0132a459e930ead26991e
LOC-11 Implementing auto-closure of rooms

If a room has no activity for the configured period (currently 6 hours) it should automatically be closed:

- Any messages are scrubbed
- Any user records are scrubbed
- User sessions purged
- Failure messages removed
- Room record removed

Ran a test with the interval configured to 60 seconds. Created room, posted and left. Stdout output (with a print added) was

{noformat}
1526731411.929024 Request start
{u'action': u'schedulerTrigger', u'pass': u'eGET8AfbG9y2BWjDZjg3BoiKuXdyU32CE1dnyJ8FJsuRtxuZ5LvMqoLVIhkQ3gx8'}
127.0.0.1 - - [19/May/2018 13:03:31] "POST / HTTP/1.1" 200 -
1526731471.993863 Request start
{u'action': u'schedulerTrigger', u'pass': u'eGET8AfbG9y2BWjDZjg3BoiKuXdyU32CE1dnyJ8FJsuRtxuZ5LvMqoLVIhkQ3gx8'}
(1, u'BenTest2')
127.0.0.1 - - [19/May/2018 13:04:31] "POST / HTTP/1.1" 200 -
1526731532.039276 Request start
{u'action': u'schedulerTrigger', u'pass': u'eGET8AfbG9y2BWjDZjg3BoiKuXdyU32CE1dnyJ8FJsuRtxuZ5LvMqoLVIhkQ3gx8'}
127.0.0.1 - - [19/May/2018 13:05:32] "POST / HTTP/1.1" 200 -
{noformat}

So I'm happy the purge is running.

This absolutely should not be relied on as an alternative to running {{/room close [pass]}} though. It's meant as a safety net and nothing more.
server/LocalChat.py