Don't delete uploaded logs (#3540)

This commit is contained in:
Jorge Martin Espinosa
2024-10-01 13:31:34 +02:00
committed by GitHub
parent bb11bc5494
commit 12948b147d

View File

@@ -114,7 +114,6 @@ class DefaultBugReporter @Inject constructor(
else -> compressFile(file)
}
}
files.deleteAllExceptMostRecent()
}
if (withCrashLogs || withDevicesLogs) {
saveLogCat()
@@ -316,20 +315,6 @@ class DefaultBugReporter @Inject constructor(
}.orEmpty()
}
/**
* Delete all the log files except the most recent one.
*/
private fun List<File>.deleteAllExceptMostRecent() {
if (size > 1) {
val mostRecentFile = maxByOrNull { it.lastModified() }
forEach { file ->
if (file != mostRecentFile) {
file.safeDelete()
}
}
}
}
// ==============================================================================================================
// Logcat management
// ==============================================================================================================