summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_aml-decision.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-22 15:24:45 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-22 15:24:45 +0100
commitf221db1c035cf9e596300e79fe928c9edc5af2d0 (patch)
treef2097c3224b6737f87ba5d71386c675db6f1e5da /src/exchange/taler-exchange-httpd_aml-decision.c
parentf8bfc4dc9d9dcb69ccdd95258aea53dabf997246 (diff)
downloadexchange-f221db1c035cf9e596300e79fe928c9edc5af2d0.tar.gz
exchange-f221db1c035cf9e596300e79fe928c9edc5af2d0.tar.bz2
exchange-f221db1c035cf9e596300e79fe928c9edc5af2d0.zip
-address FIXMEs
Diffstat (limited to 'src/exchange/taler-exchange-httpd_aml-decision.c')
-rw-r--r--src/exchange/taler-exchange-httpd_aml-decision.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_aml-decision.c b/src/exchange/taler-exchange-httpd_aml-decision.c
index 4589c8eb9..ae2667c1d 100644
--- a/src/exchange/taler-exchange-httpd_aml-decision.c
+++ b/src/exchange/taler-exchange-httpd_aml-decision.c
@@ -30,6 +30,12 @@
#include "taler-exchange-httpd_responses.h"
+/**
+ * How often do we try the DB operation at most?
+ */
+#define MAX_RETRIES 10
+
+
MHD_RESULT
TEH_handler_post_aml_decision (
struct TEH_RequestContext *rc,
@@ -80,7 +86,7 @@ TEH_handler_post_aml_decision (
&new_threshold,
&h_payto,
new_state,
- &officer_pub,
+ officer_pub,
&officer_sig))
{
GNUNET_break_op (0);
@@ -94,19 +100,21 @@ TEH_handler_post_aml_decision (
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Timestamp last_date;
bool invalid_officer;
+ unsigned int retries_left = MAX_RETRIES;
do {
- // FIXME: bound loop?
qs = TEH_plugin->insert_aml_decision (TEH_plugin->cls,
&h_payto,
&new_threshold,
new_state,
decision_time,
justification,
- &officer_pub,
+ officer_pub,
&officer_sig,
&invalid_officer,
&last_date);
+ if (0 == --retries_left)
+ break;
} while (GNUNET_DB_STATUS_SOFT_ERROR == qs);
if (qs < 0)
{