gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix taler-auditor-sync: needs tw


From: gnunet
Subject: [taler-exchange] branch master updated: fix taler-auditor-sync: needs two plugins running in parallel with their own prepare counters
Date: Sat, 22 Oct 2022 14:46:55 +0200

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 cedcde49 fix taler-auditor-sync: needs two plugins running in parallel 
with their own prepare counters
cedcde49 is described below

commit cedcde4939d560783286b533d01fbe6163dc5766
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Oct 22 14:46:52 2022 +0200

    fix taler-auditor-sync: needs two plugins running in parallel with their 
own prepare counters
---
 src/auditor/taler-auditor-sync.c |  2 +-
 src/auditor/test-sync.sh         |  3 +++
 src/exchangedb/pg_helper.h       | 17 ++++++++++++++---
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c
index 16ace8fa..803328f2 100644
--- a/src/auditor/taler-auditor-sync.c
+++ b/src/auditor/taler-auditor-sync.c
@@ -392,7 +392,7 @@ do_sync (void *cls)
  * @param value actual value of the option (a string)
  * @return #GNUNET_OK
  */
-static int
+static enum GNUNET_GenericReturnValue
 set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
               void *scls,
               const char *option,
diff --git a/src/auditor/test-sync.sh b/src/auditor/test-sync.sh
index 174e03c6..0293dbec 100755
--- a/src/auditor/test-sync.sh
+++ b/src/auditor/test-sync.sh
@@ -62,6 +62,9 @@ function check_with_database()
     psql -Aqt talercheck-in -q -1 -f $1.sql >/dev/null || exit_skip "Failed to 
load database"
 
     echo -n "."
+    echo "Please run:"
+    echo "taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t"
+    bash
     taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
 
     # cs_nonce_locks excluded: no point
diff --git a/src/exchangedb/pg_helper.h b/src/exchangedb/pg_helper.h
index 3e9ce7b4..4b585966 100644
--- a/src/exchangedb/pg_helper.h
+++ b/src/exchangedb/pg_helper.h
@@ -108,9 +108,19 @@ struct PostgresClosure
  */
 #define PREPARE(pg,name,sql)                      \
   do {                                            \
-    static unsigned long long prep_cnt;           \
+    static struct {                               \
+      unsigned long long cnt;                     \
+      struct PostgresClosure *pg;                 \
+    } preps[2]; /* 2 ctrs for taler-auditor-sync*/ \
+    unsigned int off = 0;                         \
                                                   \
-    if (prep_cnt < pg->prep_gen)                  \
+    while ( (NULL != preps[off].pg) &&            \
+            (pg != preps[off].pg) &&              \
+            (off < sizeof(preps) / sizeof(*preps)) ) \
+    off++;                                      \
+    GNUNET_assert (off <                          \
+                   sizeof(preps) / sizeof(*preps)); \
+    if (preps[off].cnt < pg->prep_gen)            \
     {                                             \
       struct GNUNET_PQ_PreparedStatement ps[] = { \
         GNUNET_PQ_make_prepare (name, sql),       \
@@ -124,7 +134,8 @@ struct PostgresClosure
         GNUNET_break (0);                         \
         return GNUNET_DB_STATUS_HARD_ERROR;       \
       }                                           \
-      prep_cnt = pg->prep_gen;                    \
+      preps[off].pg = pg;                         \
+      preps[off].cnt = pg->prep_gen;              \
     }                                             \
   } while (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]