Zip larger log files only

This commit is contained in:
M66B 2023-01-01 10:25:36 +01:00
parent 3d70d5aa22
commit 302d201d19
1 changed files with 3 additions and 2 deletions

View File

@ -174,6 +174,7 @@ public class Log {
private static final long MAX_LOG_SIZE = 8 * 1024 * 1024L;
private static final int MAX_CRASH_REPORTS = (BuildConfig.TEST_RELEASE ? 50 : 5);
private static final long MIN_FILE_SIZE = 1024 * 1024L;
private static final long MIN_ZIP_SIZE = 1024 * 1024L;
private static final String TAG = "fairemail";
// https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
@ -2631,7 +2632,7 @@ public class Log {
}
db.attachment().setDownloaded(attachment.id, size);
if (!BuildConfig.DEBUG)
if (!BuildConfig.DEBUG && size > MIN_ZIP_SIZE)
attachment.zip(context);
} catch (Throwable ex) {
Log.e(ex);
@ -2741,7 +2742,7 @@ public class Log {
}
db.attachment().setDownloaded(attachment.id, size);
if (!BuildConfig.DEBUG)
if (!BuildConfig.DEBUG && size > MIN_ZIP_SIZE)
attachment.zip(context);
} finally {
if (proc != null)