gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -address FIXMEs


From: gnunet
Subject: [taler-exchange] branch master updated: -address FIXMEs
Date: Sun, 22 Jan 2023 15:24:53 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new f221db1c -address FIXMEs
f221db1c is described below

commit f221db1c035cf9e596300e79fe928c9edc5af2d0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jan 22 15:24:45 2023 +0100

    -address FIXMEs
---
 src/exchange/taler-exchange-httpd_aml-decision.c           | 14 +++++++++++---
 .../taler-exchange-httpd_management_aml-officers.c         | 10 +++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_aml-decision.c 
b/src/exchange/taler-exchange-httpd_aml-decision.c
index 4589c8eb..ae2667c1 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)
     {
diff --git a/src/exchange/taler-exchange-httpd_management_aml-officers.c 
b/src/exchange/taler-exchange-httpd_management_aml-officers.c
index b82c18d4..abc7c3d8 100644
--- a/src/exchange/taler-exchange-httpd_management_aml-officers.c
+++ b/src/exchange/taler-exchange-httpd_management_aml-officers.c
@@ -31,6 +31,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_management_aml_officers (
   struct MHD_Connection *connection,
@@ -90,9 +96,9 @@ TEH_handler_management_aml_officers (
   {
     enum GNUNET_DB_QueryStatus qs;
     struct GNUNET_TIME_Timestamp last_date;
+    unsigned int retries_left = MAX_RETRIES;
 
     do {
-      // FIXME: bound loop!
       qs = TEH_plugin->insert_aml_officer (TEH_plugin->cls,
                                            &officer_pub,
                                            &master_sig,
@@ -101,6 +107,8 @@ TEH_handler_management_aml_officers (
                                            read_only,
                                            change_date,
                                            &last_date);
+      if (0 == --retries_left)
+        break;
     } while (GNUNET_DB_STATUS_SOFT_ERROR == qs);
     if (qs < 0)
     {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]