Skip to content

Conversation

@qstokkink
Copy link
Contributor

@qstokkink qstokkink commented Dec 11, 2024

Fixes #8320

This PR:

  • Updates the upgrade script to use db_session's retry* instead of manually committing and rolling back.
  • Updates the try .. catch constructions to be even more defensive.
  • Removes the ignored ignore ANN101 (ruff complained about this).

*To my dismay, retry cannot be used in a context manager. So, I had to refactor all the function bodies, the bits inside db_session, into separate functions with a db_session decorator.

@qstokkink qstokkink changed the title WIP: Use db_session retry and more exception handling in upgrade READY: Use db_session retry and more exception handling in upgrade Dec 11, 2024
@qstokkink qstokkink marked this pull request as ready for review December 11, 2024 14:13
@qstokkink qstokkink changed the title READY: Use db_session retry and more exception handling in upgrade Use db_session retry and more exception handling in upgrade Dec 11, 2024
@qstokkink qstokkink merged commit c10d14f into Tribler:main Dec 11, 2024
7 checks passed
@qstokkink qstokkink deleted the upd_try_upgrade branch December 11, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Unable to import old torrent files from tribler v7.1.4 to v8.0.6

2 participants