ndb: switch profile queries to use transactions

this should ensure no crashing occurs when querying profiles
This commit is contained in:
William Casarin
2023-09-10 14:51:55 -07:00
parent 622a436589
commit fc9b9f2940
51 changed files with 435 additions and 252 deletions

View File

@@ -137,6 +137,7 @@ class EventData {
}
class EventCache {
// TODO: remove me and change code to use ndb directly
private let ndb: Ndb
private var events: [NoteId: NostrEvent] = [:]
private var replies = ReplyMap()
@@ -253,9 +254,11 @@ class EventCache {
return ev
}
/*
func lookup_by_key(_ key: UInt64) -> NostrEvent? {
ndb.lookup_note_by_key(key)
}
*/
func lookup(_ evid: NoteId) -> NostrEvent? {
return events[evid]