diff --git a/lib/lichess.py b/lib/lichess.py index 1d8426ca5..c691736f5 100644 --- a/lib/lichess.py +++ b/lib/lichess.py @@ -105,7 +105,7 @@ def get_challenge_timeout(challenge_response: ChallengeType) -> datetime.timedel def is_final(exception: Exception) -> bool: """If `is_final` returns True then we won't retry.""" return (isinstance(exception, HTTPError) and exception.response is not None and exception.response.status_code < 500 - or stop.terminated or stop.force_quit) + or stop.force_quit) def backoff_handler(details: BackoffDetails) -> None: diff --git a/lib/lichess_bot.py b/lib/lichess_bot.py index 769d598b2..8f4f20277 100644 --- a/lib/lichess_bot.py +++ b/lib/lichess_bot.py @@ -88,14 +88,11 @@ def disable_restart() -> None: def signal_handler(signal: int, frame: FrameType | None) -> None: # noqa: ARG001 """Terminate lichess-bot.""" - in_starting_thread = __name__ == "__main__" if not stop.terminated: - if in_starting_thread: - logger.debug("Received SIGINT. Terminating client.") + logger.debug("Received SIGINT. Terminating client.") stop.terminated = True else: - if in_starting_thread: - logger.debug("Received second SIGINT. Quitting now.") + logger.debug("Received second SIGINT. Quitting now.") stop.force_quit = True