mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -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:
|
||||
if not corrupt and not dev_mode and not self.restoring_backup:
|
||||
# default 5 minute throttle
|
||||
self.col.create_backup(
|
||||
backup_folder=self.pm.backupFolder(),
|
||||
force=False,
|
||||
wait_for_completion=False,
|
||||
)
|
||||
try:
|
||||
# default 5 minute throttle
|
||||
self.col.create_backup(
|
||||
backup_folder=self.pm.backupFolder(),
|
||||
force=False,
|
||||
wait_for_completion=False,
|
||||
)
|
||||
except:
|
||||
print("backup on close failed")
|
||||
self.col.close(downgrade=False)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
|
Loading…
Reference in a new issue