diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-03-19 19:33:20 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-03-19 19:33:20 +0100 |
commit | f76e7c46e6609d39d5b28cb489a946833ca58bfb (patch) | |
tree | f111ba1e0249c45374248e85fb4d7ca096e542b3 /src/testing/testing_api_cmd_bank_admin_add_incoming.c | |
parent | 5e98c0652a6a03a7ce70405fa53adf706412b24b (diff) | |
download | exchange-f76e7c46e6609d39d5b28cb489a946833ca58bfb.tar.xz |
make do_retry not retry forever in tests/benchmark
Diffstat (limited to 'src/testing/testing_api_cmd_bank_admin_add_incoming.c')
-rw-r--r-- | src/testing/testing_api_cmd_bank_admin_add_incoming.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/testing/testing_api_cmd_bank_admin_add_incoming.c b/src/testing/testing_api_cmd_bank_admin_add_incoming.c index 2398c5be3..6e707a2e4 100644 --- a/src/testing/testing_api_cmd_bank_admin_add_incoming.c +++ b/src/testing/testing_api_cmd_bank_admin_add_incoming.c @@ -33,6 +33,12 @@ /** + * How often do we retry before giving up? + */ +#define NUM_RETRIES 5 + + +/** * State for a "fakebank transfer" CMD. */ struct AdminAddIncomingState @@ -120,9 +126,9 @@ struct AdminAddIncomingState /** * Was this command modified via * #TALER_TESTING_cmd_admin_add_incoming_with_retry to - * enable retries? + * enable retries? If so, how often should we still retry? */ - int do_retry; + unsigned int do_retry; }; @@ -184,8 +190,9 @@ confirmation_cb (void *cls, fts->aih = NULL; if (MHD_HTTP_OK != http_status) { - if (GNUNET_YES == fts->do_retry) + if (0 != fts->do_retry) { + fts->do_retry--; if ( (0 == http_status) || (TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) || (MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) ) @@ -588,7 +595,7 @@ TALER_TESTING_cmd_admin_add_incoming_retry (struct TALER_TESTING_Command cmd) GNUNET_assert (&admin_add_incoming_run == cmd.run); fts = cmd.cls; - fts->do_retry = GNUNET_YES; + fts->do_retry = NUM_RETRIES; return cmd; } |