Fix DatabasePool.change(passphrase:)

This commit is contained in:
Gwendal Roué committed 2019-09-01 19:33:03 +02:00
1 parent 04a6e969a5
commit c7e4492846
1 file changed
+3 -2
+3 -2
View File
@@ -243,10 +243,11 @@ extension DatabasePool {
/// Changes the passphrase of an encrypted database
public func change(passphrase: String) throws {
try readerPool.clear(andThen: {
try readerPool.barrier {
try writer.sync { try $0.change(passphrase: passphrase) }
readerPool.removeAll()
readerConfig.passphrase = passphrase
})
}
}
}
#endif