Revert "Revert "nostrdb: close database when backgrounded""
This reverts commit 26bd50c948.
This commit is contained in:
@@ -29,7 +29,14 @@ class NdbTxn<T> {
|
||||
self.inherited = true
|
||||
} else {
|
||||
self.txn = ndb_txn()
|
||||
let _ = ndb_begin_query(ndb.ndb.ndb, &self.txn)
|
||||
let ok = ndb_begin_query(ndb.ndb.ndb, &self.txn) != 0
|
||||
if !ok {
|
||||
self.moved = false
|
||||
self.txn = ndb_txn()
|
||||
self.inherited = true
|
||||
self.val = with(self)
|
||||
return
|
||||
}
|
||||
Thread.current.threadDictionary["ndb_txn"] = self.txn
|
||||
self.inherited = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user