SQLITE_BUSY prevention

This commit is contained in:
Justin Mazzocchi 2020-11-12 17:53:08 -08:00
parent 199e813754
commit 0b7b3d3dc4
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -18,6 +18,8 @@ extension DatabasePool {
do { do {
var configuration = Configuration() var configuration = Configuration()
configuration.busyMode = .timeout(5)
configuration.defaultTransactionKind = .immediate
configuration.prepareDatabase { db in configuration.prepareDatabase { db in
try db.usePassphrase(passphrase()) try db.usePassphrase(passphrase())
try db.execute(sql: "PRAGMA cipher_plaintext_header_size = 32") try db.execute(sql: "PRAGMA cipher_plaintext_header_size = 32")