From 4c395f4ee0843423b4843416f202eb734f40c6d3 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 29 Nov 2006 02:40:12 +0000 Subject: [PATCH] added some safety checks to prevent search timeout errors git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6630 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 0d7e20ca7e..1cf9ac5fa2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -1019,9 +1019,13 @@ sub marc_search { my $recs = search_cache($ckey, $offset, $limit); if(!$recs) { - $recs = $U->storagereq($method, %$args); - put_cache($ckey, scalar(@$recs), $recs); - $recs = [ @$recs[$offset..($offset + ($limit - 1))] ]; + $recs = $U->storagereq($method, %$args) || []; + if( $recs ) { + put_cache($ckey, scalar(@$recs), $recs); + $recs = [ @$recs[$offset..($offset + ($limit - 1))] ]; + } else { + $recs = []; + } } my $count = 0; -- 2.11.0