Network optimizations

This commit is contained in:
Ali
2023-02-07 23:23:18 +04:00
parent 5f3de7a40b
commit f6be1e4120
17 changed files with 295 additions and 133 deletions

View File

@@ -1212,6 +1212,11 @@ public final class Transaction {
self.postbox!.messageHistoryThreadIndexTable.set(peerId: peerId, threadId: threadId, info: info)
}
public func setMessageHistoryThreads(peerId: PeerId) -> [Int64] {
assert(!self.disposed)
return self.postbox!.messageHistoryThreadIndexTable.getAll(peerId: peerId).map(\.threadId)
}
public func getPeerThreadCombinedState(peerId: PeerId) -> StoredPeerThreadCombinedState? {
assert(!self.disposed)
return self.postbox!.peerThreadCombinedStateTable.get(peerId: peerId)
@@ -1302,7 +1307,7 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
#if DEBUG
//debugSaveState(basePath: basePath + "/db", name: "previous2")
debugRestoreState(basePath: basePath + "/db", name: "previous2")
//debugRestoreState(basePath: basePath + "/db", name: "previous2")
#endif
let startTime = CFAbsoluteTimeGetCurrent()