summaryrefslogtreecommitdiff
path: root/src/c/urweb.c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-01-23 18:16:30 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-01-23 18:16:30 -0500
commit25f4d797b606f568497c194c080e8808aea973a5 (patch)
treee667f8ad9df5e0e7f41b0bbc2f2d4f074eb0ccc2 /src/c/urweb.c
parent2fc1b44bdddc7bdb99cd94849f7372fd427481f1 (diff)
Proper error handling for periodic tasks
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r--src/c/urweb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 67df7a2e..693cc87f 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3684,15 +3684,12 @@ uw_Basis_postBody uw_getPostBody(uw_context ctx) {
failure_kind uw_runCallback(uw_context ctx, void (*callback)(uw_context)) {
int r = setjmp(ctx->jmp_buf);
- if (ctx->app->db_begin(ctx))
- uw_error(ctx, BOUNDED_RETRY, "Error running SQL BEGIN");
-
if (r == 0) {
+ if (ctx->app->db_begin(ctx))
+ uw_error(ctx, BOUNDED_RETRY, "Error running SQL BEGIN");
+
callback(ctx);
- uw_commit(ctx);
}
- else
- uw_rollback(ctx, 0);
return r;
}