$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);
}
}
}
+ # 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