Bugzilla – Attachment 69822 Details for
Bug 19819
C4::Context->dbh is unreasonably slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19819: C4::Context->dbh is unreasonably slow
Bug-19819-C4Context-dbh-is-unreasonably-slow.patch (text/plain), 943 bytes, created by
David Gustafsson
on 2017-12-15 11:03:05 UTC
(
hide
)
Description:
Bug 19819: C4::Context->dbh is unreasonably slow
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2017-12-15 11:03:05 UTC
Size:
943 bytes
patch
obsolete
>From 3c7e0ffd42a62652918f66052ff5a3e8233273d0 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Fri, 15 Dec 2017 11:59:57 +0100 >Subject: [PATCH] Bug 19819: C4::Context->dbh is unreasonably slow > >Locally cache Koha::Database->schema->storage->dbh in state variable in >C4::Context->dbh to get rid of retrieval overhead >--- > C4/Context.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 1aa08be050..a8b073c85c 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -688,9 +688,13 @@ sub dbh > my $self = shift; > my $params = shift; > my $sth; >+ state $dbh; > > unless ( $params->{new} ) { >- return Koha::Database->schema->storage->dbh; >+ unless ($dbh) { >+ $dbh = Koha::Database->schema->storage->dbh; >+ } >+ return $dbh; > } > > return Koha::Database->schema({ new => 1 })->storage->dbh; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19819
:
69822
|
70249