From c1a7d866b3fbea487d36fb8876a4fbd0b3d0854a Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 27 Nov 2006 16:26:30 +0000 Subject: [PATCH] added some safety checks for search timeouts in marc search git-svn-id: svn://svn.open-ils.org/ILS/trunk@6617 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