diff options
Diffstat (limited to 'src/testing/testing_api_cmd_deposit.c')
-rw-r--r-- | src/testing/testing_api_cmd_deposit.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index 573c68b9c..6781568a1 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -30,6 +30,12 @@ /** + * How often do we retry before giving up? + */ +#define NUM_RETRIES 5 + + +/** * State for a "deposit" CMD. */ struct DepositState @@ -104,9 +110,9 @@ struct DepositState 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; /** * Set to #GNUNET_YES if the /deposit succeeded @@ -184,8 +190,9 @@ deposit_cb (void *cls, ds->dh = NULL; if (ds->expected_response_code != http_status) { - if (GNUNET_YES == ds->do_retry) + if (0 != ds->do_retry) { + ds->do_retry--; if ( (0 == http_status) || (TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) || (MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) ) @@ -559,7 +566,7 @@ TALER_TESTING_cmd_deposit_with_retry (struct TALER_TESTING_Command cmd) GNUNET_assert (&deposit_run == cmd.run); ds = cmd.cls; - ds->do_retry = GNUNET_YES; + ds->do_retry = NUM_RETRIES; return cmd; } |