mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Flush logs before trimming to size.
There are situations where we may be hitting our SQLITE_BUSY timeout when we go to trim. One possibility is that we may have a large ongoing write when we go to trim. So, this change just makes sure we're caught up before we go to trim, which is the simplest thing we can do to address this. It's not a foolproof solution though, so if we still see it crop up, we'll just have to re-route all log operations through the single thread we have setup in the PersistentLogger or something.
This commit is contained in:
@@ -258,7 +258,10 @@ public class ApplicationContext extends MultiDexApplication implements AppForegr
|
||||
|
||||
SignalProtocolLoggerProvider.setProvider(new CustomSignalProtocolLogger());
|
||||
|
||||
SignalExecutors.UNBOUNDED.execute(() -> LogDatabase.getInstance(this).trimToSize());
|
||||
SignalExecutors.UNBOUNDED.execute(() -> {
|
||||
Log.blockUntilAllWritesFinished();
|
||||
LogDatabase.getInstance(this).trimToSize();
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeCrashHandling() {
|
||||
|
||||
Reference in New Issue
Block a user