Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pgn error catching #1034

Merged

Conversation

MarkZH
Copy link
Collaborator

@MarkZH MarkZH commented Oct 12, 2024

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

An exception raised within the write_pgn_record() thread will stop any more PGN records from being written. This PR catches all exceptions and logs them so that future games will be saved to files.

In the case of an exception being raised from pgn_queue.get() (usually when Ctrl-C is pressed), the InterruptedError is caught and ignored. Some additional logic ensures that task_done() is called for every successful get() call.

Related Issues:

N/A

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

N/A

@AttackingOrDefending AttackingOrDefending merged commit c0ae365 into lichess-bot-devs:master Oct 13, 2024
21 checks passed
@MarkZH MarkZH deleted the pgn-error-catching branch October 14, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants