mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Use shared queue for postbox
This commit is contained in:
parent
99dc1729a0
commit
1ac4eb51e8
@ -932,15 +932,17 @@ func debugRestoreState(basePath:String, name: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private let sharedQueue = Queue(name: "org.telegram.postbox.Postbox")
|
||||||
|
|
||||||
public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration, encryptionParameters: ValueBoxEncryptionParameters) -> Signal<PostboxResult, NoError> {
|
public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration, encryptionParameters: ValueBoxEncryptionParameters) -> Signal<PostboxResult, NoError> {
|
||||||
let queue = Queue(name: "org.telegram.postbox.Postbox")
|
let queue = sharedQueue
|
||||||
return Signal { subscriber in
|
return Signal { subscriber in
|
||||||
queue.async {
|
queue.async {
|
||||||
let _ = try? FileManager.default.createDirectory(atPath: basePath, withIntermediateDirectories: true, attributes: nil)
|
let _ = try? FileManager.default.createDirectory(atPath: basePath, withIntermediateDirectories: true, attributes: nil)
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
//debugSaveState(basePath: basePath, name: "previous1")
|
//debugSaveState(basePath: basePath, name: "previous1")
|
||||||
debugRestoreState(basePath: basePath, name: "previous1")
|
//debugRestoreState(basePath: basePath, name: "previous1")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
let startTime = CFAbsoluteTimeGetCurrent()
|
let startTime = CFAbsoluteTimeGetCurrent()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user