aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-13 14:55:58 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-13 14:55:58 +0100
commit9c20b62eb965c2b8a9e94f56283d5671e37bc447 (patch)
treecda1596854b194e6686459ecfa0aed186c5a10aa /src
parent8d5f42fe0cff134120e462c7e905403f7d38b9d6 (diff)
database setup logic is now external to httpd
Diffstat (limited to 'src')
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c8
-rwxr-xr-xsrc/exchange/test_taler_exchange_httpd.sh4
-rwxr-xr-xsrc/exchange/test_taler_exchange_httpd_restart.sh4
3 files changed, 13 insertions, 3 deletions
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index 4515e7795..2f1b5234d 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -37,7 +37,8 @@
* @param field name of the database field to fetch amount from
* @param[out] amountp pointer to amount to set
*/
-#define TALER_PQ_RESULT_SPEC_AMOUNT(field,amountp) TALER_PQ_result_spec_amount ( \
+#define TALER_PQ_RESULT_SPEC_AMOUNT(field,amountp) \
+ TALER_PQ_result_spec_amount ( \
field,pg->currency,amountp)
/**
@@ -62,6 +63,11 @@ struct TALER_AUDITORDB_Session
*/
struct GNUNET_PQ_Context *conn;
+ /**
+ * Name of the ongoing transaction, used to debug cases where
+ * a transaction is not properly terminated via COMMIT or
+ * ROLLBACK.
+ */
const char *transaction_name;
};
diff --git a/src/exchange/test_taler_exchange_httpd.sh b/src/exchange/test_taler_exchange_httpd.sh
index 2ff5830d2..dabe79cb7 100755
--- a/src/exchange/test_taler_exchange_httpd.sh
+++ b/src/exchange/test_taler_exchange_httpd.sh
@@ -29,12 +29,14 @@ PREFIX=
# Uncomment this line to run with valgrind...
# PREFIX="valgrind --leak-check=yes --track-fds=yes --error-exitcode=1 --log-file=valgrind.%p"
+# Setup database
+taler-exchange-dbinit -c test_taler_exchange_httpd.conf &> /dev/null
# Setup keys.
taler-exchange-keyup -c test_taler_exchange_httpd.conf || exit 1
# Setup wire accounts.
taler-exchange-wire -c test_taler_exchange_httpd.conf > /dev/null || exit 1
# Run Exchange HTTPD (in background)
-$PREFIX taler-exchange-httpd -c test_taler_exchange_httpd.conf -i 2> test-exchange.log &
+$PREFIX taler-exchange-httpd -c test_taler_exchange_httpd.conf 2> test-exchange.log &
# Give HTTP time to start
diff --git a/src/exchange/test_taler_exchange_httpd_restart.sh b/src/exchange/test_taler_exchange_httpd_restart.sh
index f7d7a3050..a8976fb0c 100755
--- a/src/exchange/test_taler_exchange_httpd_restart.sh
+++ b/src/exchange/test_taler_exchange_httpd_restart.sh
@@ -51,12 +51,14 @@ PREFIX=
# Uncomment this line to run with valgrind...
# PREFIX="valgrind --trace-children=yes --leak-check=yes --track-fds=yes --error-exitcode=1 --log-file=valgrind.%p"
+# Setup database
+taler-exchange-dbinit -c test_taler_exchange_unix.conf &> /dev/null
# Setup keys.
taler-exchange-keyup -c test_taler_exchange_unix.conf || exit 1
# Setup wire accounts.
taler-exchange-wire -c test_taler_exchange_unix.conf > /dev/null || exit 1
# Run Exchange HTTPD (in background)
-$PREFIX taler-exchange-httpd -c test_taler_exchange_unix.conf -i 2> test-exchange.log &
+$PREFIX taler-exchange-httpd -c test_taler_exchange_unix.conf 2> test-exchange.log &
# Where should we be bound to?
UNIXPATH=`taler-config -s exchange -f -o UNIXPATH`