Adds recovery of sqlite db when db is opened (#516)

Co-authored-by: Donncha Ó Cearbhaill <donncha.ocearbhaill@amnesty.org>
This commit is contained in:
Tek
2024-10-17 11:28:13 +02:00
committed by GitHub
parent 477f9a7f6b
commit 7303bc06e5

View File

@@ -49,7 +49,11 @@ class IOSExtraction(MVTModule):
"""
# TODO: Find a better solution.
if not forced:
conn = self._open_sqlite_db(file_path)
# If the database is open, do not use immutable
if os.path.isfile(file_path + "-shm"):
conn = sqlite3.connect(file_path)
else:
conn = self._open_sqlite_db(file_path)
cur = conn.cursor()
try: