Debug: classifier file size

This commit is contained in:
M66B
2023-01-11 10:44:14 +01:00
parent ee3475e998
commit 8b65ef6b34
2 changed files with 9 additions and 2 deletions

View File

@@ -2048,6 +2048,10 @@ public class Log {
.append(TextHelper.canTransliterate())
.append("\r\n");
sb.append("Classifier: ")
.append(Helper.humanReadableByteCount(MessageClassifier.getSize(context)))
.append("\r\n");
sb.append("\r\n");
int cpus = Runtime.getRuntime().availableProcessors();

View File

@@ -759,8 +759,11 @@ public class MessageClassifier {
}
static long getSize(Context context) {
File file = getFile(context, false);
return (file.exists() ? file.length() : -1L);
try {
return getFile(context, false).length();
} catch (Throwable ignored) {
return -1L;
}
}
private static class State {