[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: fix hanging db
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: fix hanging db |
Date: |
Tue, 20 Jun 2017 15:00:22 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 3322051 fix hanging db
3322051 is described below
commit 3322051a39621448ed4d893a96de465e5ab86e6f
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jun 20 15:00:28 2017 +0200
fix hanging db
---
src/backend/taler-merchant-httpd_refund.c | 10 ++++++++++
src/backenddb/plugin_merchantdb_postgres.c | 18 ++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_refund.c
b/src/backend/taler-merchant-httpd_refund.c
index 2504333..229bbe5 100644
--- a/src/backend/taler-merchant-httpd_refund.c
+++ b/src/backend/taler-merchant-httpd_refund.c
@@ -250,6 +250,16 @@ MH_handler_refund_increase (struct TMH_RequestHandler *rh,
" or too big to be paid back");
}
+ if (GNUNET_SYSERR == res)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not commit refund increase\n");
+ GNUNET_JSON_parse_free (spec);
+ return TMH_RESPONSE_reply_internal_error (connection,
+ TALER_EC_NONE,
+ "Internal hard db error");
+ }
+
/**
* Return to the frontend at this point. The frontend will then return
* a "402 Payment required" carrying a "X-Taler-Refund-Url: www"
diff --git a/src/backenddb/plugin_merchantdb_postgres.c
b/src/backenddb/plugin_merchantdb_postgres.c
index 679b055..dd45163 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -2156,6 +2156,7 @@ postgres_increase_refund_for_contract (void *cls,
params,
&process_deposits_cb,
&ctx);
+
switch (ret)
{
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
@@ -2170,18 +2171,15 @@ postgres_increase_refund_for_contract (void *cls,
return GNUNET_SYSERR;
default:
/* Got one or more deposits */
+ if (GNUNET_OK != postgres_commit (cls))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to commit transaction increasing refund\n");
+ return GNUNET_SYSERR;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Committed db transaction\n");
return ctx.err;
- break;
}
-
- if (GNUNET_OK != postgres_commit (cls))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to commit transaction increasing refund\n");
- return GNUNET_SYSERR;
- }
-
- return GNUNET_OK;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: fix hanging db,
gnunet <=