mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 16:10:17 +00:00
Changed the way it uses the database connection to be more robust
This commit is contained in:
parent
209099cc5e
commit
17371088da
@@ -14,8 +14,11 @@ class BackupService:
|
|||||||
db_path = DirectoryManager.get_database_path()
|
db_path = DirectoryManager.get_database_path()
|
||||||
if not db_path.exists():
|
if not db_path.exists():
|
||||||
raise FileNotFoundError("No Database Found")
|
raise FileNotFoundError("No Database Found")
|
||||||
conn = self.session.connection().connection
|
|
||||||
dump = "\n".join(line for line in conn.iterdump())
|
with self.session.connection() as conn:
|
||||||
|
raw_conn = conn.connection
|
||||||
|
dump = dump = "\n".join(line for line in raw_conn.iterdump())
|
||||||
|
|
||||||
filename = DirectoryManager.get_config_directory() / "backup.zip"
|
filename = DirectoryManager.get_config_directory() / "backup.zip"
|
||||||
diaries_root_path = DirectoryManager.get_diaries_root()
|
diaries_root_path = DirectoryManager.get_diaries_root()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user