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_transfer.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_transfer.c')
-rw-r--r-- | src/testing/testing_api_cmd_bank_transfer.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/testing/testing_api_cmd_bank_transfer.c b/src/testing/testing_api_cmd_bank_transfer.c index f8dfc0b83..03bf5973c 100644 --- a/src/testing/testing_api_cmd_bank_transfer.c +++ b/src/testing/testing_api_cmd_bank_transfer.c @@ -33,6 +33,12 @@ /** + * How often do we retry before giving up? + */ +#define NUM_RETRIES 5 + + +/** * State for a "transfer" CMD. */ struct TransferState @@ -113,9 +119,9 @@ struct TransferState /** * 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; }; @@ -175,8 +181,9 @@ confirmation_cb (void *cls, fts->weh = 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) ) @@ -397,9 +404,9 @@ TALER_TESTING_cmd_transfer_retry (struct TALER_TESTING_Command cmd) GNUNET_assert (&transfer_run == cmd.run); fts = cmd.cls; - fts->do_retry = GNUNET_YES; + fts->do_retry = NUM_RETRIES; return cmd; } -/* end of testing_api_cmd_transfer.c */ +/* end of testing_api_cmd_bank_transfer.c */ |