summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-19 19:33:20 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-19 19:33:20 +0100
commitf76e7c46e6609d39d5b28cb489a946833ca58bfb (patch)
treef111ba1e0249c45374248e85fb4d7ca096e542b3 /src/testing/testing_api_cmd_auditor_deposit_confirmation.c
parent5e98c0652a6a03a7ce70405fa53adf706412b24b (diff)
downloadexchange-f76e7c46e6609d39d5b28cb489a946833ca58bfb.tar.gz
exchange-f76e7c46e6609d39d5b28cb489a946833ca58bfb.tar.bz2
exchange-f76e7c46e6609d39d5b28cb489a946833ca58bfb.zip
make do_retry not retry forever in tests/benchmark
Diffstat (limited to 'src/testing/testing_api_cmd_auditor_deposit_confirmation.c')
-rw-r--r--src/testing/testing_api_cmd_auditor_deposit_confirmation.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
index 96d0740e..bcef59c5 100644
--- a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
+++ b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
@@ -29,6 +29,11 @@
#include "taler_signatures.h"
#include "backoff.h"
+/**
+ * How often do we retry before giving up?
+ */
+#define NUM_RETRIES 5
+
/**
* State for a "deposit confirmation" CMD.
@@ -83,9 +88,9 @@ struct DepositConfirmationState
unsigned int expected_response_code;
/**
- * Should we retry on (transient) failures?
+ * How often should we retry on (transient) failures?
*/
- int do_retry;
+ unsigned int do_retry;
};
@@ -140,8 +145,9 @@ deposit_confirmation_cb (void *cls,
dcs->dc = NULL;
if (dcs->expected_response_code != http_status)
{
- if (GNUNET_YES == dcs->do_retry)
+ if (0 != dcs->do_retry)
{
+ dcs->do_retry--;
if ( (0 == http_status) ||
(TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) ||
(MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) )
@@ -436,7 +442,7 @@ TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command
GNUNET_assert (&deposit_confirmation_run == cmd.run);
dcs = cmd.cls;
- dcs->do_retry = GNUNET_YES;
+ dcs->do_retry = NUM_RETRIES;
return cmd;
}