From ab8e426cae07d43ec7862c9ea9cc4279902bde8b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 1 Apr 2024 20:34:50 +0200 Subject: return error code from taler-merchant-exchange if ever any transaction had an issue --- src/backend/taler-merchant-exchange.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/backend/taler-merchant-exchange.c b/src/backend/taler-merchant-exchange.c index e499589e..80802956 100644 --- a/src/backend/taler-merchant-exchange.c +++ b/src/backend/taler-merchant-exchange.c @@ -237,6 +237,11 @@ static struct GNUNET_DB_EventHandler *eh; */ static unsigned int active_inquiries; +/** + * Set to true if we ever encountered any problem. + */ +static bool found_problem; + /** * Value to return from main(). 0 on success, non-zero on errors. */ @@ -394,6 +399,8 @@ update_transaction_status (const struct Inquiry *w, { enum GNUNET_DB_QueryStatus qs; + if (failed) + found_problem = true; qs = db_plugin->update_transfer_status (db_plugin->cls, w->exchange->exchange_url, &w->wtid, @@ -1273,6 +1280,9 @@ main (int argc, return EXIT_INVALIDARGUMENT; if (GNUNET_NO == ret) return EXIT_SUCCESS; + if ( (found_problem) && + (0 == global_ret) ) + global_ret = 7; return global_ret; } -- cgit v1.2.3