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:
- Adding a timeout mechanism to remove empty games that have been idle for a certain period
- Calling
_delete_game when a game has been empty for too long
- 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
Originally posted by @Copilot in #155