From a05e87cadacd4f81c3150fdf92b8acf7141d150e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 17 Oct 2015 11:08:12 -0400 Subject: Switching to a more dynamic method of handling database reconnection, restarting transactions --- src/c/urweb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/c') diff --git a/src/c/urweb.c b/src/c/urweb.c index 4ce469bd..9371147b 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -811,12 +811,9 @@ static void uw_try_reconnecting(uw_context ctx) { uw_error(ctx, FATAL, "Error reopening database connection"); } -int uw_try_reconnecting_if_at_most_one(uw_context ctx) { - if (ctx->at_most_one_query) { - uw_try_reconnecting(ctx); - return 1; - } else - return 0; +void uw_try_reconnecting_and_restarting(uw_context ctx) { + uw_try_reconnecting(ctx); + uw_error(ctx, UNLIMITED_RETRY, "Restarting transaction after fixing database connection"); } void uw_ensure_transaction(uw_context ctx) { -- cgit v1.2.3