We need to get the in-use copy proximity separately, as they are already filtered...
authorMike Rylander <mrylander@gmail.com>
Tue, 20 Jul 2021 15:21:05 +0000 (11:21 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 20 Jul 2021 15:21:05 +0000 (11:21 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm

index 6180ae7..64f1970 100644 (file)
@@ -761,6 +761,14 @@ sub compile_weighted_proximity_map {
         push(@{$prox_map{$prox}}, $copy_hash) foreach (1 .. $weight);
     }
 
+    # We need to grab the proximity for copies targeted by other holds
+    # that belong to this pickup lib for hard-stalling tests later. We'll
+    # just grab them all in case it's useful later.
+    for my $copy_hash (@{$self->in_use_copies}) {
+        my $prox = $copy_prox_map{$copy_hash->{id}};
+        $copy_hash->{proximity} = $prox;
+    }
+
     return $self->{weighted_prox_map} = \%prox_map;
 }