From: Damyan Ivanov Date: Thu, 6 Dec 2018 05:30:20 +0000 (+0000) Subject: abort saving transaction after the second attempt X-Git-Tag: v0.3~333 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=1976f73e2af2e2085eb881826147b6a5ef1a9257;p=mobile-ledger.git abort saving transaction after the second attempt the first may fail because of a missing session or a missing or wrong token, but the second must succeed if everything is alright --- diff --git a/app/src/main/java/net/ktnx/mobileledger/SaveTransactionTask.java b/app/src/main/java/net/ktnx/mobileledger/SaveTransactionTask.java index 79cf7dc2..ae15b446 100644 --- a/app/src/main/java/net/ktnx/mobileledger/SaveTransactionTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/SaveTransactionTask.java @@ -127,7 +127,7 @@ class SaveTransactionTask extends AsyncTask { while (! send_ok() ) { try { tried++; - if (tried >= 3) + if (tried >= 2) throw new IOException(String.format("aborting after %d tries", tried)); sleep(100); } catch (InterruptedException e) {