]> git.ktnx.net Git - mobile-ledger.git/commitdiff
abort saving transaction after the second attempt
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 6 Dec 2018 05:30:20 +0000 (05:30 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 6 Dec 2018 05:30:20 +0000 (05:30 +0000)
the first may fail because of a missing session or a missing or wrong
token, but the second must succeed if everything is alright

app/src/main/java/net/ktnx/mobileledger/SaveTransactionTask.java

index 79cf7dc27f538daa68ff3dd6e4f88624bb975179..ae15b446d7853041942af78762daf7916a644fdc 100644 (file)
@@ -127,7 +127,7 @@ class SaveTransactionTask extends AsyncTask<LedgerTransaction, Void, Void> {
             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) {