Skip to content

Remove sessions after last user disconnects #11

@angelsl

Description

@angelsl

Currently sessions are never removed from memory, and we prevent the server from running out of memory by externally restarting it every Sunday morning.

Instead of this, we can automatically remove sessions from the ShareDB some time after the last user disconnects.

Implementation:

  1. Track the number of users connected to each session by binding to the WebSocket connect/disconnect events. Also track the last disconnect time.
  2. Every hour or so, remove sessions that have no users and whose last disconnection time is more than an hour old.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions