Skip to content

Commit

Permalink
Improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Jul 31, 2021
1 parent a8b12a0 commit 3658323
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/src/main/java/eu/faircode/email/ServiceSynchronize.java
Expand Up @@ -1254,9 +1254,10 @@ public void notification(StoreEvent e) {

if ("Still here".equals(message) &&
!account.isTransient(ServiceSynchronize.this)) {
long now = new Date().getTime();
if (now - start < STILL_THERE_THRESHOLD)
optimizeAccount(account, message);
long elapsed = new Date().getTime() - start;
if (elapsed < STILL_THERE_THRESHOLD)
optimizeAccount(account, "'" + message + "'" +
" elapsed=" + elapsed + " ms");
}
} else
try {
Expand Down Expand Up @@ -2248,7 +2249,9 @@ private void optimizeAccount(EntityAccount account, String reason) {
DB db = DB.getInstance(this);

int pollInterval = getPollInterval(this);
EntityLog.log(this, "Auto optimize account=" + account.name + " poll interval=" + pollInterval);
EntityLog.log(this, account.name + " auto optimize" +
" reason=" + reason +
" poll interval=" + pollInterval);
if (pollInterval == 0) {
try {
db.beginTransaction();
Expand Down

0 comments on commit 3658323

Please sign in to comment.