gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: resolve #7124: ensure -s also de


From: gnunet
Subject: [taler-exchange] branch master updated: resolve #7124: ensure -s also deletes work_shards
Date: Sun, 26 Dec 2021 13:05:50 +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 070f442a resolve #7124: ensure -s also deletes work_shards
070f442a is described below

commit 070f442a1182c7c2a09c42e94ce202509ade1b77
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 26 13:05:39 2021 +0100

    resolve #7124: ensure -s also deletes work_shards
---
 src/exchange-tools/taler-exchange-dbinit.c  |  2 +-
 src/exchangedb/plugin_exchangedb_postgres.c | 22 +++++++++-------------
 src/include/taler_exchangedb_plugin.h       |  2 +-
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/exchange-tools/taler-exchange-dbinit.c 
b/src/exchange-tools/taler-exchange-dbinit.c
index 32f0570f..a5e6a94a 100644
--- a/src/exchange-tools/taler-exchange-dbinit.c
+++ b/src/exchange-tools/taler-exchange-dbinit.c
@@ -105,7 +105,7 @@ run (void *cls,
     if (clear_shards)
     {
       if (0 >
-          plugin->delete_revolving_shards (plugin->cls))
+          plugin->delete_shard_locks (plugin->cls))
       {
         fprintf (stderr,
                  "Clearing revolving shards failed!\n");
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 6ef1bb03..97782bd1 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2743,11 +2743,6 @@ prepare_statements (struct PostgresClosure *pg)
       "   AND start_row=$2"
       "   AND end_row=$3",
       3),
-    /* Used in #postgres_delete_revolving_shards() */
-    GNUNET_PQ_make_prepare (
-      "delete_revolving_shards",
-      "DELETE FROM revolving_work_shards",
-      0),
     GNUNET_PQ_PREPARED_STATEMENT_END
   };
 
@@ -11385,16 +11380,17 @@ postgres_release_revolving_shard (void *cls,
  * @return transaction status code
  */
 enum GNUNET_DB_QueryStatus
-postgres_delete_revolving_shards (void *cls)
+postgres_delete_shard_locks (void *cls)
 {
   struct PostgresClosure *pg = cls;
-  struct GNUNET_PQ_QueryParam params[] = {
-    GNUNET_PQ_query_param_end
+  struct GNUNET_PQ_ExecuteStatement es[] = {
+    GNUNET_PQ_make_execute ("DELETE FROM work_shards;"),
+    GNUNET_PQ_make_execute ("DELETE FROM revolving_work_shards;"),
+    GNUNET_PQ_EXECUTE_STATEMENT_END
   };
 
-  return GNUNET_PQ_eval_prepared_non_select (pg->conn,
-                                             "delete_revolving_shards",
-                                             params);
+  return GNUNET_PQ_exec_statements (pg->conn,
+                                    es);
 }
 
 
@@ -11630,8 +11626,8 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
     = &postgres_begin_revolving_shard;
   plugin->release_revolving_shard
     = &postgres_release_revolving_shard;
-  plugin->delete_revolving_shards
-    = &postgres_delete_revolving_shards;
+  plugin->delete_shard_locks
+    = &postgres_delete_shard_locks;
   return plugin;
 }
 
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index ad6e58a0..ee691084 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -4022,7 +4022,7 @@ struct TALER_EXCHANGEDB_Plugin
    * @return transaction status code
    */
   enum GNUNET_DB_QueryStatus
-  (*delete_revolving_shards)(void *cls);
+  (*delete_shard_locks)(void *cls);
 
   /**
    * TODO-oec: add function for adding extension config

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