[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: actually implement -t option for
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: actually implement -t option for taler-merchant-wirewatch |
Date: |
Thu, 13 Apr 2023 17:55:33 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new ee478c6c actually implement -t option for taler-merchant-wirewatch
ee478c6c is described below
commit ee478c6c8097ac385dbfeeb80d186a1f108b304c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Apr 13 17:55:31 2023 +0200
actually implement -t option for taler-merchant-wirewatch
---
src/backend/taler-merchant-wirewatch.c | 18 +++++++++++++++++-
src/testing/test_merchant_api.c | 3 ++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/backend/taler-merchant-wirewatch.c
b/src/backend/taler-merchant-wirewatch.c
index 2c62b446..7ffc4e10 100644
--- a/src/backend/taler-merchant-wirewatch.c
+++ b/src/backend/taler-merchant-wirewatch.c
@@ -110,6 +110,11 @@ static uint64_t start_row;
*/
static bool progress_update;
+/**
+ * Set to true if we found a transaction in the last iteration.
+ */
+static bool found;
+
/**
* Save progress in DB.
@@ -261,6 +266,7 @@ credit_cb (
char *exchange_url;
struct TALER_WireTransferIdentifierRawP wtid;
+ found = true;
if (GNUNET_OK !=
parse_subject (details->wire_subject,
&wtid,
@@ -303,6 +309,13 @@ credit_cb (
break;
}
hh = NULL;
+ if (test_mode && (! found))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "No transactions found and in test mode. Shutting down!\n");
+ GNUNET_SCHEDULER_shutdown ();
+ return GNUNET_OK;
+ }
task = GNUNET_SCHEDULER_add_delayed (delay,
&do_work,
NULL);
@@ -315,11 +328,14 @@ do_work (void *cls)
{
(void) cls;
task = NULL;
+ found = false;
hh = TALER_MERCHANT_BANK_credit_history (ctx,
&ad,
start_row,
batch_size,
- BANK_TIMEOUT,
+ test_mode
+ ? GNUNET_TIME_UNIT_ZERO
+ : BANK_TIMEOUT,
&credit_cb,
NULL);
if (NULL == hh)
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index d4fe16cd..a106b8be 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -2052,7 +2052,8 @@ main (int argc,
NULL,
config_file);
- GNUNET_OS_process_kill (merchantd, SIGTERM);
+ GNUNET_OS_process_kill (merchantd,
+ SIGTERM);
GNUNET_OS_process_wait (merchantd);
GNUNET_OS_process_destroy (merchantd);
GNUNET_free (merchant_url);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: actually implement -t option for taler-merchant-wirewatch,
gnunet <=