Skip to content

Expire old games #158

@markrcote

Description

@markrcote

Games are never removed from the database or memory once created, leading to a memory and database storage leak. The _delete_game method is defined but never called anywhere in the codebase.

Empty games in WAITING state with no players should be cleaned up after some period of inactivity. Consider:

  1. Adding a timeout mechanism to remove empty games that have been idle for a certain period
  2. Calling _delete_game when a game has been empty for too long
  3. Removing the game from self.games dictionary and calling _delete_game(game_id) to clean up database entries

Without cleanup, the database will grow indefinitely with stale game records, and the server memory will also grow as games are never removed from the self.games dictionary.

Originally posted by @Copilot in #155

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions