From 1976f73e2af2e2085eb881826147b6a5ef1a9257 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 6 Dec 2018 05:30:20 +0000 Subject: [PATCH] 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 --- .../main/java/net/ktnx/mobileledger/SaveTransactionTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.39.5