lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
744 stars 440 forks source link

Allow graceful shutdown -- finish current games, don't accept new ones, exit when no games left to play #1010

Closed arvyy closed 2 weeks ago

arvyy commented 2 weeks ago

Is your feature request related to a problem? Please describe.

I want to go to sleep and turn off computer, but I don't want to abandon live games. Sometimes when the last game is finished, a new one is started by another bot creating a challenge

Describe the solution you'd like

When configured through options, control-c would cause the bot to finish active games, without starting any new ones, and exit when all games are completed.

Describe alternatives you've considered

Additional context

MarkZH commented 2 weeks ago

Add this line to your config.yml file with no indentation:

quit_after_all_games_finish: true # If set to true, then pressing Ctrl-C to quit will only stop lichess-bot after all current games have finished.

More details in the wiki

arvyy commented 2 weeks ago

very sorry, not sure how I missed it

MarkZH commented 2 weeks ago

No problem. It's a long wiki page.