hgducharme / lichess-bot

A middle-man between your chess engine and lichess.com
GNU General Public License v3.0
1 stars 0 forks source link

Cleanup termination process #2

Open hgducharme opened 2 years ago

hgducharme commented 2 years ago

Implement a graceful shutdown of the program

hgducharme commented 1 year ago

Issue: If we have games open while we're trying to shutdown, the game_manager.terminate_all_games(wait = False) line will throw an exception saying the game doesn't exist. I think there's a race condition in there somewhere

hgducharme commented 1 year ago
  1. Rescind all challenges sent
  2. Abort/resign all games
  3. Shutdown all ChessGame threads
  4. Close connection to Lichess API
  5. Shutdown EventStreamDispatcher and ChallengeStreamWatcher