Bugzilla – Attachment 70249 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), 992 bytes, created by
Josef Moravec
on 2018-01-03 14:58:16 UTC
(
hide
)
Description:
Bug 19819: C4::Context->dbh is unreasonably slow
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-01-03 14:58:16 UTC
Size:
992 bytes
patch
obsolete
>From 231c9d106cb7a7c8f39690522dd8f2257c69e3fc 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 > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Context.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 1eb5f88..79dd36f 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -689,9 +689,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.1.4
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