Bugzilla – Attachment 48549 Details for
Bug 15958
ZOOM/Zebra-connection cache flushing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15958 - ZOOM/Zebra-connection cache flushing
Bug-15958---ZOOMZebra-connection-cache-flushing.patch (text/plain), 1.26 KB, created by
Olli-Antti Kivilahti
on 2016-03-02 16:32:44 UTC
(
hide
)
Description:
Bug 15958 - ZOOM/Zebra-connection cache flushing
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2016-03-02 16:32:44 UTC
Size:
1.26 KB
patch
obsolete
>From 6fa9d1f2e8cd0d4caccc153c2eff5cbe3cb82301 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 2 Mar 2016 18:31:51 +0200 >Subject: [PATCH] Bug 15958 - ZOOM/Zebra-connection cache flushing > >When writing tests related to searching, When searching the local index >repeatedly, changes in the index are not applied to the search results if >the results always return the same records. > >This is due to ZOOM caching the results. >This feature adds a ZOOM::Connection flushing subroutine to get rid of old >caches. >--- > C4/Context.pm | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/C4/Context.pm b/C4/Context.pm >index e5a4ab3..7a5eb77 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -782,6 +782,21 @@ sub _new_Zconn { > return $Zconn; > } > >+=head2 flushZconns >+ >+Destroys all Zebra connections flushing their caches. >+ >+=cut >+ >+sub flushZconns { >+ my @ZconnKeys = keys%{$context->{"Zconn"}} if ref($context->{"Zconn"}) eq 'HASH'; >+ foreach my $key (@ZconnKeys) { >+ my $Zc = $context->{"Zconn"}->{$key}; >+ $Zc->destroy(); >+ delete $context->{"Zconn"}->{$key}; >+ } >+} >+ > # _new_dbh > # Internal helper function (not a method!). This creates a new > # database connection from the data given in the current context, and >-- >1.9.1
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 15958
: 48549