Merge branch 'charlesmchen/dbReadPoolSize'
This commit is contained in:
commit
a01734d6d4
@ -80,21 +80,21 @@ class NSEContext: NSObject, AppContext {
|
||||
private func applicationWillResignActive(_ notification: NSNotification) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
Logger.info("... memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
Logger.info("memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
}
|
||||
|
||||
@objc
|
||||
private func applicationWillTerminate(_ notification: NSNotification) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
Logger.info("... memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
Logger.info("memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
}
|
||||
|
||||
@objc
|
||||
private func applicationDidReceiveMemoryWarning(_ notification: NSNotification) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
Logger.info("... memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
Logger.info("memoryUsage: \(LocalDevice.memoryUsage)")
|
||||
}
|
||||
|
||||
// MARK: - Unused in this extension
|
||||
|
||||
@ -128,6 +128,7 @@ NSString *NSStringForOWSReceiptType(OWSReceiptType receiptType)
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
[self logMemoryUsage];
|
||||
return;
|
||||
}
|
||||
|
||||
@ -141,6 +142,7 @@ NSString *NSStringForOWSReceiptType(OWSReceiptType receiptType)
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
[self logMemoryUsage];
|
||||
return;
|
||||
}
|
||||
|
||||
@ -155,6 +157,7 @@ NSString *NSStringForOWSReceiptType(OWSReceiptType receiptType)
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
[self logMemoryUsage];
|
||||
return;
|
||||
}
|
||||
|
||||
@ -181,6 +184,14 @@ NSString *NSStringForOWSReceiptType(OWSReceiptType receiptType)
|
||||
});
|
||||
}
|
||||
|
||||
- (void)logMemoryUsage {
|
||||
if (SSKDebugFlags.internalLogging) {
|
||||
dispatch_async(self.serialQueue, ^{
|
||||
OWSLogVerbose(@"memoryUsage: %@", LocalDevice.memoryUsage);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray<AnyPromise *> *)sendReceiptsForReceiptType:(OWSReceiptType)receiptType {
|
||||
__block NSDictionary<SignalServiceAddress *, MessageReceiptSet *> *queuedReceiptMap;
|
||||
[self.databaseStorage readWithBlock:^(SDSAnyReadTransaction *transaction) {
|
||||
|
||||
@ -889,7 +889,8 @@ private struct GRDBStorage {
|
||||
}
|
||||
// Useful when your app opens multiple databases
|
||||
configuration.label = "GRDB Storage"
|
||||
configuration.maximumReaderCount = 10 // The default is 5
|
||||
let isMainApp = CurrentAppContext().isMainApp
|
||||
configuration.maximumReaderCount = isMainApp ? 10 : 5 // The default is 5
|
||||
configuration.busyMode = .callback({ (retryCount: Int) -> Bool in
|
||||
// sleep N milliseconds
|
||||
let millis = 25
|
||||
|
||||
Loading…
Reference in New Issue
Block a user