mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 11:50:56 +00:00
Add more logs
This commit is contained in:
parent
c9cf1ae1d1
commit
2ad13066c5
@ -124,7 +124,7 @@ final class AccountManagerImpl {
|
|||||||
self.tables.append(self.sharedDataTable)
|
self.tables.append(self.sharedDataTable)
|
||||||
self.tables.append(self.noticeTable)
|
self.tables.append(self.noticeTable)
|
||||||
|
|
||||||
print("AccountManager initialization took \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
postboxLog("AccountManager initialization took \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
|
|||||||
@ -1129,6 +1129,8 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
|
|||||||
let queue = sharedQueue
|
let queue = sharedQueue
|
||||||
return Signal { subscriber in
|
return Signal { subscriber in
|
||||||
queue.async {
|
queue.async {
|
||||||
|
postboxLog("openPostbox, basePath: \(basePath), useCopy: \(useCopy)")
|
||||||
|
|
||||||
let _ = try? FileManager.default.createDirectory(atPath: basePath, withIntermediateDirectories: true, attributes: nil)
|
let _ = try? FileManager.default.createDirectory(atPath: basePath, withIntermediateDirectories: true, attributes: nil)
|
||||||
|
|
||||||
var tempDir: TempBoxDirectory?
|
var tempDir: TempBoxDirectory?
|
||||||
@ -1149,6 +1151,7 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
postboxLog("openPostbox, error1")
|
||||||
subscriber.putNext(.error)
|
subscriber.putNext(.error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1164,9 +1167,13 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
|
|||||||
|
|
||||||
let startTime = CFAbsoluteTimeGetCurrent()
|
let startTime = CFAbsoluteTimeGetCurrent()
|
||||||
|
|
||||||
|
postboxLog("openPostbox, initialize SqliteValueBox")
|
||||||
|
|
||||||
guard var valueBox = SqliteValueBox(basePath: dbBasePath, queue: queue, isTemporary: isTemporary, isReadOnly: isReadOnly, encryptionParameters: encryptionParameters, upgradeProgress: { progress in
|
guard var valueBox = SqliteValueBox(basePath: dbBasePath, queue: queue, isTemporary: isTemporary, isReadOnly: isReadOnly, encryptionParameters: encryptionParameters, upgradeProgress: { progress in
|
||||||
|
postboxLog("openPostbox, SqliteValueBox upgrading progress \(progress)")
|
||||||
subscriber.putNext(.upgrading(progress))
|
subscriber.putNext(.upgrading(progress))
|
||||||
}) else {
|
}) else {
|
||||||
|
postboxLog("openPostbox, SqliteValueBox open error")
|
||||||
subscriber.putNext(.error)
|
subscriber.putNext(.error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1177,9 +1184,12 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
|
|||||||
let userVersion: Int32? = metadataTable.userVersion()
|
let userVersion: Int32? = metadataTable.userVersion()
|
||||||
let currentUserVersion: Int32 = 25
|
let currentUserVersion: Int32 = 25
|
||||||
|
|
||||||
|
postboxLog("openPostbox, current userVersion: \(userVersion ?? nil)")
|
||||||
|
|
||||||
if let userVersion = userVersion {
|
if let userVersion = userVersion {
|
||||||
if userVersion != currentUserVersion {
|
if userVersion != currentUserVersion {
|
||||||
if isTemporary {
|
if isTemporary {
|
||||||
|
postboxLog("openPostbox, isTemporary = true, not upgrading")
|
||||||
subscriber.putNext(.error)
|
subscriber.putNext(.error)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
@ -1241,9 +1251,12 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration,
|
|||||||
}
|
}
|
||||||
|
|
||||||
let endTime = CFAbsoluteTimeGetCurrent()
|
let endTime = CFAbsoluteTimeGetCurrent()
|
||||||
print("Postbox load took \((endTime - startTime) * 1000.0) ms")
|
postboxLog("Postbox load took \((endTime - startTime) * 1000.0) ms")
|
||||||
|
|
||||||
subscriber.putNext(.postbox(Postbox(queue: queue, basePath: basePath, seedConfiguration: seedConfiguration, valueBox: valueBox, timestampForAbsoluteTimeBasedOperations: timestampForAbsoluteTimeBasedOperations, isTemporary: isTemporary, tempDir: tempDir)))
|
subscriber.putNext(.postbox(Postbox(queue: queue, basePath: basePath, seedConfiguration: seedConfiguration, valueBox: valueBox, timestampForAbsoluteTimeBasedOperations: timestampForAbsoluteTimeBasedOperations, isTemporary: isTemporary, tempDir: tempDir)))
|
||||||
|
|
||||||
|
postboxLog("openPostbox, putCompletion")
|
||||||
|
|
||||||
subscriber.putCompletion()
|
subscriber.putCompletion()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1407,7 +1420,7 @@ public final class Postbox {
|
|||||||
self.seedConfiguration = seedConfiguration
|
self.seedConfiguration = seedConfiguration
|
||||||
self.tempDir = tempDir
|
self.tempDir = tempDir
|
||||||
|
|
||||||
print("MediaBox path: \(self.basePath + "/media")")
|
postboxLog("MediaBox path: \(self.basePath + "/media")")
|
||||||
|
|
||||||
self.mediaBox = MediaBox(basePath: self.basePath + "/media")
|
self.mediaBox = MediaBox(basePath: self.basePath + "/media")
|
||||||
self.valueBox = valueBox
|
self.valueBox = valueBox
|
||||||
@ -1546,7 +1559,7 @@ public final class Postbox {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
print("(Postbox initialization took \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
postboxLog("(Postbox initialization took \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
||||||
|
|
||||||
let _ = self.transaction({ transaction -> Void in
|
let _ = self.transaction({ transaction -> Void in
|
||||||
let reindexUnreadVersion: Int32 = 2
|
let reindexUnreadVersion: Int32 = 2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user