gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -more logical DB notify for aggr


From: gnunet
Subject: [taler-exchange] branch master updated: -more logical DB notify for aggregator
Date: Wed, 06 Mar 2024 09:46:36 +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 7d40a312 -more logical DB notify for aggregator
7d40a312 is described below

commit 7d40a312835d2ce3ab93ef10189c70123421b222
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Mar 6 09:46:09 2024 +0100

    -more logical DB notify for aggregator
---
 src/exchange/taler-exchange-aggregator.c | 20 ++++++++++++++++++--
 src/exchangedb/pg_aggregate.c            | 15 ++-------------
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/exchange/taler-exchange-aggregator.c 
b/src/exchange/taler-exchange-aggregator.c
index fa7b02b0..691d65ae 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -28,6 +28,7 @@
 #include "taler_json_lib.h"
 #include "taler_kyclogic_lib.h"
 #include "taler_bank_service.h"
+#include "taler_dbevents.h"
 
 
 /**
@@ -824,15 +825,30 @@ do_aggregate (struct AggregationUnit *au)
   {
   case GNUNET_DB_STATUS_SOFT_ERROR:
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Serialization issue during aggregation; trying again 
later!\n");
+                "Serialization issue during aggregation; trying again 
later!\n")
+    ;
     return GNUNET_NO;
   case GNUNET_DB_STATUS_HARD_ERROR:
     GNUNET_break (0);
     global_ret = EXIT_FAILURE;
     return GNUNET_SYSERR;
   default:
-    return GNUNET_OK;
+    break;
+  }
+  {
+    struct TALER_CoinDepositEventP rep = {
+      .header.size = htons (sizeof (rep)),
+      .header.type = htons (TALER_DBEVENT_EXCHANGE_DEPOSIT_STATUS_CHANGED),
+      .merchant_pub = au->merchant_pub
+    };
+
+    db_plugin->event_notify (db_plugin->cls,
+                             &rep.header,
+                             NULL,
+                             0);
   }
+  return GNUNET_OK;
+
 }
 
 
diff --git a/src/exchangedb/pg_aggregate.c b/src/exchangedb/pg_aggregate.c
index 16805d75..ba03e4a9 100644
--- a/src/exchangedb/pg_aggregate.c
+++ b/src/exchangedb/pg_aggregate.c
@@ -122,7 +122,8 @@ TEH_PG_aggregate (
            "    SELECT batch_deposit_serial_id,$4"
            "      FROM bdep)"
            "SELECT" /* calculate totals (deposits, refunds and fees) */
-           "  CAST(COALESCE(SUM((cdep.amount).val),0) AS INT8) AS 
sum_deposit_value" /* cast needed, otherwise we get NUMBER */
+           "  CAST(COALESCE(SUM((cdep.amount).val),0) AS INT8) AS 
sum_deposit_value"
+           /* cast needed, otherwise we get NUMBER */
            " ,COALESCE(SUM((cdep.amount).frac),0) AS sum_deposit_fraction" /* 
SUM over INT returns INT8 */
            " ,CAST(COALESCE(SUM((ref.refund).val),0) AS INT8) AS 
sum_refund_value"
            " ,COALESCE(SUM((ref.refund).frac),0) AS sum_refund_fraction"
@@ -174,18 +175,6 @@ TEH_PG_aggregate (
                                           total));
     return qs;
   }
-  {
-    struct TALER_CoinDepositEventP rep = {
-      .header.size = htons (sizeof (rep)),
-      .header.type = htons (TALER_DBEVENT_EXCHANGE_DEPOSIT_STATUS_CHANGED),
-      .merchant_pub = *merchant_pub
-    };
-
-    TEH_PG_event_notify (pg,
-                         &rep.header,
-                         NULL,
-                         0);
-  }
   GNUNET_assert (GNUNET_OK ==
                  TALER_amount_set_zero (pg->currency,
                                         &sum_deposit));

-- 
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]