From 1ac4eb51e84e3b6adc59abac6b0e97b8e3e8b246 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Thu, 27 Jun 2019 01:12:02 +0300 Subject: [PATCH] Use shared queue for postbox --- submodules/Postbox/Postbox/Postbox.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/submodules/Postbox/Postbox/Postbox.swift b/submodules/Postbox/Postbox/Postbox.swift index 6f5097236a..d08006c7e2 100644 --- a/submodules/Postbox/Postbox/Postbox.swift +++ b/submodules/Postbox/Postbox/Postbox.swift @@ -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 { - let queue = Queue(name: "org.telegram.postbox.Postbox") + let queue = sharedQueue return Signal { subscriber in queue.async { let _ = try? FileManager.default.createDirectory(atPath: basePath, withIntermediateDirectories: true, attributes: nil) #if DEBUG //debugSaveState(basePath: basePath, name: "previous1") - debugRestoreState(basePath: basePath, name: "previous1") + //debugRestoreState(basePath: basePath, name: "previous1") #endif let startTime = CFAbsoluteTimeGetCurrent()