aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-06-26 00:09:01 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-06-26 00:09:01 +0200
commitb87d1112ea479537bda5e1ba1e1100ee53315315 (patch)
tree4a8f95d685770228ad5e76342a663eabcf355805 /src/exchangedb
parentddedf03a816e5139b235a3ebdf5b600508c5ed5f (diff)
parent421129a32ed88fee49108c76e67c16b60f95116b (diff)
downloadexchange-b87d1112ea479537bda5e1ba1e1100ee53315315.tar.xz
Merge branch 'master' into age-withdraw-merge
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/exchange_do_batch_reserves_update.sql4
-rw-r--r--src/exchangedb/exchange_do_insert_kyc_attributes.sql6
-rw-r--r--src/exchangedb/pg_insert_aml_decision.c1
-rw-r--r--src/exchangedb/pg_insert_kyc_attributes.c8
-rw-r--r--src/exchangedb/pg_reserves_in_insert.c2
-rwxr-xr-xsrc/exchangedb/test_idempotency.sh4
6 files changed, 20 insertions, 5 deletions
diff --git a/src/exchangedb/exchange_do_batch_reserves_update.sql b/src/exchangedb/exchange_do_batch_reserves_update.sql
index 82b6b84c1..39920629b 100644
--- a/src/exchangedb/exchange_do_batch_reserves_update.sql
+++ b/src/exchangedb/exchange_do_batch_reserves_update.sql
@@ -65,7 +65,9 @@ BEGIN
,expiration_date=GREATEST(expiration_date,in_expiration_date)
,gc_date=GREATEST(gc_date,in_expiration_date)
WHERE reserve_pub=in_reserve_pub;
- PERFORM pg_notify(in_notify, NULL);
+ EXECUTE FORMAT (
+ 'NOTIFY %s'
+ ,in_notify);
ELSE
out_duplicate = TRUE;
END IF;
diff --git a/src/exchangedb/exchange_do_insert_kyc_attributes.sql b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
index 949181399..ae6a65759 100644
--- a/src/exchangedb/exchange_do_insert_kyc_attributes.sql
+++ b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
@@ -75,8 +75,10 @@ THEN
UPDATE SET status=EXCLUDED.status | 1;
END IF;
--- Wake up everyone who might care...
-PERFORM pg_notify (in_kyc_completed_notify_s, NULL);
+EXECUTE FORMAT (
+ 'NOTIFY %s'
+ ,in_kyc_completed_notify_s);
+
INSERT INTO kyc_alerts
(h_payto
diff --git a/src/exchangedb/pg_insert_aml_decision.c b/src/exchangedb/pg_insert_aml_decision.c
index 62645c2a2..fcf67ee46 100644
--- a/src/exchangedb/pg_insert_aml_decision.c
+++ b/src/exchangedb/pg_insert_aml_decision.c
@@ -89,6 +89,7 @@ TEH_PG_insert_aml_decision (
params,
rs);
GNUNET_free (notify_s);
+ GNUNET_PQ_event_do_poll (pg->conn);
if (NULL != kyc_s)
free (kyc_s);
return qs;
diff --git a/src/exchangedb/pg_insert_kyc_attributes.c b/src/exchangedb/pg_insert_kyc_attributes.c
index 361f491e8..e3c246e5c 100644
--- a/src/exchangedb/pg_insert_kyc_attributes.c
+++ b/src/exchangedb/pg_insert_kyc_attributes.c
@@ -25,6 +25,9 @@
#include "pg_insert_kyc_attributes.h"
#include "pg_helper.h"
+void
+event_do_poll (struct GNUNET_PQ_Context *db);
+
enum GNUNET_DB_QueryStatus
TEH_PG_insert_kyc_attributes (
@@ -81,6 +84,9 @@ TEH_PG_insert_kyc_attributes (
};
enum GNUNET_DB_QueryStatus qs;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Inserting KYC attributes, wake up on %s\n",
+ kyc_completed_notify_s);
PREPARE (pg,
"insert_kyc_attributes",
"SELECT "
@@ -92,6 +98,8 @@ TEH_PG_insert_kyc_attributes (
params,
rs);
GNUNET_free (kyc_completed_notify_s);
+ GNUNET_PQ_event_do_poll (pg->conn);
+
if (qs < 0)
return qs;
if (! ok)
diff --git a/src/exchangedb/pg_reserves_in_insert.c b/src/exchangedb/pg_reserves_in_insert.c
index 72fde7499..7f59826c7 100644
--- a/src/exchangedb/pg_reserves_in_insert.c
+++ b/src/exchangedb/pg_reserves_in_insert.c
@@ -611,6 +611,7 @@ TEH_PG_reserves_in_insert (
reserves_length,
batch_size,
results);
+ GNUNET_PQ_event_do_poll (pg->conn);
for (unsigned int i = 0; i<reserves_length; i++)
GNUNET_free (rrs[i].notify_s);
return qs;
@@ -889,6 +890,7 @@ TEH_PG_reserves_in_insertN (
}
}
finished:
+ GNUNET_PQ_event_do_poll (pg->conn);
for (unsigned int i = 0; i<reserves_length; i++)
GNUNET_free (rrs[i].notify_s);
return qs;
diff --git a/src/exchangedb/test_idempotency.sh b/src/exchangedb/test_idempotency.sh
index 6ab5d1332..66f712c1c 100755
--- a/src/exchangedb/test_idempotency.sh
+++ b/src/exchangedb/test_idempotency.sh
@@ -2,9 +2,9 @@
# This file is in the public domain.
set -eu
echo "Initializing DB"
-taler-exchange-dbinit -r test-exchange-db-postgres.conf
+taler-exchange-dbinit -r -c test-exchange-db-postgres.conf
echo "Re-initializing DB"
-taler-exchange-dbinit test-exchange-db-postgres.conf
+taler-exchange-dbinit -c test-exchange-db-postgres.conf
echo "Re-loading procedures"
psql talercheck < procedures.sql
echo "Test PASSED"