Debug too many open files

This commit is contained in:
Ali 2023-10-31 16:47:24 +04:00
parent eb15434a8e
commit 70e9a7e8e5
2 changed files with 4 additions and 1 deletions

View File

@ -590,6 +590,9 @@ public final class SqliteValueBox: ValueBox {
postboxLog("isEncrypted prepare done") postboxLog("isEncrypted prepare done")
if statement == nil { if statement == nil {
postboxLog("isEncrypted: sqlite3_prepare_v2 status = \(status) [\(self.databasePath)]") postboxLog("isEncrypted: sqlite3_prepare_v2 status = \(status) [\(self.databasePath)]")
if status == 14 {
printOpenFiles()
}
return true return true
} }
if status == SQLITE_NOTADB { if status == SQLITE_NOTADB {

View File

@ -34,7 +34,7 @@ public func printOpenFiles() {
buf.withUnsafeMutableBytes { buffer -> Void in buf.withUnsafeMutableBytes { buffer -> Void in
let _ = fcntl(fd, F_GETPATH, buffer.baseAddress!) let _ = fcntl(fd, F_GETPATH, buffer.baseAddress!)
let string = String(cString: buffer.baseAddress!.assumingMemoryBound(to: CChar.self)) let string = String(cString: buffer.baseAddress!.assumingMemoryBound(to: CChar.self))
print(string) postboxLog("f: \(string)")
} }
fd += 1 fd += 1