mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
If a backup fails before close, ensure collection closed
Otherwise when user returns to profiles screen, they'll be unable to open a different profile, as the collection is still open. Encountered when opening the collection that triggered https://github.com/ankitects/anki/issues/2123
This commit is contained in:
parent
0c340c4f74
commit
e5c4ccf08c
1 changed files with 9 additions and 6 deletions
|
@ -624,12 +624,15 @@ class AnkiQt(QMainWindow):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not corrupt and not dev_mode and not self.restoring_backup:
|
if not corrupt and not dev_mode and not self.restoring_backup:
|
||||||
|
try:
|
||||||
# default 5 minute throttle
|
# default 5 minute throttle
|
||||||
self.col.create_backup(
|
self.col.create_backup(
|
||||||
backup_folder=self.pm.backupFolder(),
|
backup_folder=self.pm.backupFolder(),
|
||||||
force=False,
|
force=False,
|
||||||
wait_for_completion=False,
|
wait_for_completion=False,
|
||||||
)
|
)
|
||||||
|
except:
|
||||||
|
print("backup on close failed")
|
||||||
self.col.close(downgrade=False)
|
self.col.close(downgrade=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
Loading…
Reference in a new issue