[open-ils-commits] r7741 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Aug 29 16:22:35 EDT 2007


Author: erickson
Date: 2007-08-29 16:16:35 -0400 (Wed, 29 Aug 2007)
New Revision: 7741

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
implemented soft hold stalling by checking soft stall interval setting and passing to storage method

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2007-08-29 20:16:04 UTC (rev 7740)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2007-08-29 20:16:35 UTC (rev 7741)
@@ -1231,7 +1231,7 @@
 	my $class	= shift;
 	my $editor	= shift; # CStoreEditor object
 	my $copy		= shift; # copy to target
-	my $user		= shift; # hold recipient
+	my $user		= shift; # staff 
 	my $check_only = shift; # do no updates, just see if the copy could fulfill a hold
 	my $evt		= OpenILS::Event->new('ACTION_HOLD_REQUEST_NOT_FOUND');
 
@@ -1248,12 +1248,16 @@
 	# hold->type "R" means we need this copy
 	for my $h (@$old_holds) { return ($h) if $h->hold_type eq 'R'; }
 
-	$logger->info("circulator: searching for best hold at org ".$user->ws_ou." and copy $bc");
 
+    my $hold_stall_interval = $U->ou_ancestor_setting_value($user->ws_ou, 'circ.hold_stalling.soft');
+
+	$logger->info("circulator: searching for best hold at org ".$user->ws_ou.
+        " and copy $bc with a hold stalling interval of ". ($hold_stall_interval || "(none)"));
+
 	# search for what should be the best holds for this copy to fulfill
 	my $best_holds = $U->storagereq(
 		"open-ils.storage.action.hold_request.nearest_hold.atomic",
-		$user->ws_ou, $copy->id, 10 );
+		$user->ws_ou, $copy->id, 10, $hold_stall_interval );
 
 	unless(@$best_holds) {
 



More information about the open-ils-commits mailing list