From ae24b5c2e87db4ad108f9aa8c749da63f442975b Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Mon, 24 Jun 2019 16:58:50 -0500 Subject: [PATCH] Moved transaction commit to above fastcgi_finish_request to prevent the page refreshing before the transaction actually commits. --- index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 1ccb804e..ac46ca26 100644 --- a/index.php +++ b/index.php @@ -96,11 +96,14 @@ try { $page->display(); } + if($database->transaction===true) { + $database->commit(); + } + // saving cache data and profiling data to disk can happen later if (function_exists("fastcgi_finish_request")) { fastcgi_finish_request(); } - $database->commit(); $_shm_ctx->log_endok(); } catch (Exception $e) { if ($database) {