Bug 15958

Summary: ZOOM/Zebra-connection cache flushing
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: SearchingAssignee: Olli-Antti Kivilahti <olli-antti.kivilahti>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15958 - ZOOM/Zebra-connection cache flushing

Description Olli-Antti Kivilahti 2016-03-02 16:31:50 UTC
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.
Comment 1 Olli-Antti Kivilahti 2016-03-02 16:32:44 UTC
Created attachment 48549 [details] [review]
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.
Comment 2 Mark Tompsett 2016-04-06 12:50:47 UTC
Comment on attachment 48549 [details] [review]
Bug 15958 - ZOOM/Zebra-connection cache flushing

Review of attachment 48549 [details] [review]:
-----------------------------------------------------------------

::: C4/Context.pm
@@ +788,5 @@
> +
> +=cut
> +
> +sub flushZconns {
> +	my @ZconnKeys = keys%{$context->{"Zconn"}} if ref($context->{"Zconn"}) eq 'HASH';

Not sure how to trigger, but if $context->{"Zconn"} is undefined or not a HASH, then @ZconnKeys doesn't get defined, which will break the loop. Split declarations from conditional initializations.
Comment 3 Katrin Fischer 2017-10-15 09:38:05 UTC
Patch still applies, setting to Failed QA based on Mark's last comment. Can you please take a look?