From ddb2c93d3c1d3cfbf8443649b251c44734cfb741 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 30 Apr 2013 11:26:00 -0400 Subject: [PATCH] Make sure the "running" indicator goes away Signed-off-by: Mike Rylander Signed-off-by: Jason Etheridge --- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 5ea3602204..1b6a9cedf2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -1307,7 +1307,7 @@ sub staged_search { $cache_data = $cache->get_cache($key) || {}; last if (!$cache_data->{running}); } - } else { # we're the first ... let's give it a try + } elsif (!$cache_data->{0}) { # we're the first ... let's give it a try $cache->put_cache($key, { running => $$ }, $cache_timeout / 3); } @@ -1409,6 +1409,13 @@ sub staged_search { } } + # Let other backends grab our data now that we're done. + $cache_data = $cache->get_cache($key); + if ($$cache_data{running} and $$cache_data{running} == $$) { + delete $$cache_data{running}; + $cache->put_cache($key, $cache_data, $cache_timeout); + } + my @results = grep {defined $_} @$all_results[$user_offset..($user_offset + $user_limit - 1)]; # refine the estimate if we have more than one superpage -- 2.11.0