Credit to gmcharlt, prevents the my list (temporary list) page from
crashing when a user has added a title to the list more than once.
This can happen if they add a title then login, then redo search and
add same title. Per Galen, it looks like an issue with
OpenSRF::MultiSession parallel record retrieval causing some kind of
race condition when there are duplicate entries in the list.
Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST);
use File::Spec;
use Time::HiRes qw/time sleep/;
+use List::MoreUtils qw/uniq/;
use OpenSRF::Utils::Cache;
use OpenSRF::Utils::Logger qw/$logger/;
use OpenILS::Utils::CStoreEditor qw/:funcs/;
$self->timelog("get_records_and_facets(): about to call ".
"$unapi_type via json_query (rec_ids has " . scalar(@$rec_ids));
- my @loop_recs = @$rec_ids;
+ my @loop_recs = uniq @$rec_ids;
my %rec_timeout;
while (my $bid = shift @loop_recs) {