mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Try one more time after deleting corrupted database
This commit is contained in:
parent
cfff49d6c0
commit
1aa0d30a08
@ -363,7 +363,14 @@ public final class SqliteValueBox: ValueBox {
|
|||||||
for fileName in dabaseFileNames {
|
for fileName in dabaseFileNames {
|
||||||
let _ = try? FileManager.default.removeItem(atPath: basePath + "/\(fileName)")
|
let _ = try? FileManager.default.removeItem(atPath: basePath + "/\(fileName)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let maybeDatabase = Database(path, readOnly: false)
|
||||||
|
if let maybeDatabase = maybeDatabase {
|
||||||
|
database = maybeDatabase
|
||||||
|
} else {
|
||||||
|
let _ = try? FileManager.default.removeItem(atPath: path)
|
||||||
database = Database(path, readOnly: false)!
|
database = Database(path, readOnly: false)!
|
||||||
|
}
|
||||||
|
|
||||||
resultCode = database.execute("PRAGMA cipher_plaintext_header_size=32")
|
resultCode = database.execute("PRAGMA cipher_plaintext_header_size=32")
|
||||||
assert(resultCode)
|
assert(resultCode)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user