Moved the 'LibSession.clearLoggers' call below suspending the network

pull/1061/head
Morgan Pretty 3 days ago
parent b039fbe7b9
commit 236d072235

@ -139,7 +139,6 @@ public class SessionApp: SessionAppType {
public func resetData(onReset: (() -> ())) {
homeViewController = nil
LibSession.clearLoggers()
dependencies.remove(cache: .libSession)
dependencies.mutate(cache: .libSessionNetwork) {
$0.clearSnodeCache()
@ -152,6 +151,7 @@ public class SessionApp: SessionAppType {
try? dependencies[singleton: .keychain].removeAll()
onReset()
LibSession.clearLoggers()
Log.info("Data Reset Complete.")
Log.flush()

@ -1362,12 +1362,12 @@ class DeveloperSettingsViewModel: SessionTableViewModel, NavigatableStateHolder,
}
/// Need to shut everything down before the swap out the data to prevent crashes
LibSession.clearLoggers()
dependencies[singleton: .jobRunner].stopAndClearPendingJobs()
dependencies.remove(cache: .libSession)
dependencies.mutate(cache: .libSessionNetwork) { $0.suspendNetworkAccess() }
dependencies[singleton: .storage].suspendDatabaseAccess()
try dependencies[singleton: .storage].closeDatabase()
LibSession.clearLoggers()
let deleteEnumerator: FileManager.DirectoryEnumerator? = FileManager.default.enumerator(
at: URL(

Loading…
Cancel
Save