[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 90d868448d0e550f4a6548f8df09fcf7569ac3af

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 12:02:05 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  90d868448d0e550f4a6548f8df09fcf7569ac3af (commit)
      from  14d1a2670dcb1ca1ec7ff6bab67d2806add2ae64 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 90d868448d0e550f4a6548f8df09fcf7569ac3af
Author: Steven Callender <stevecallender at esilibrary.com>
Date:   Wed Oct 19 18:51:14 2011 +0000

    Reshelving update.
    
    Update to the reshelving code to make it faster and utilize the new status change time field on asset.copy.
    
    Signed-off-by: Steven Callender <stevecallender at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index 907b2d9..8ad87c3 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -143,41 +143,18 @@ sub complete_reshelving {
 		unless (interval_to_seconds( $window ));
 
 	my $setting = actor::org_unit_setting->table;
-	my $circ = action::circulation->table;
 	my $cp = asset::copy->table;
-	my $atc = action::transit_copy->table;
 
 	my $sql = <<"	SQL";
 		UPDATE	$cp
 		  SET	status = 0
 		  WHERE	id IN (
-			SELECT  id
-			  FROM  (SELECT cp.id, MAX(circ.checkin_time), MAX(trans.dest_recv_time)
-					  FROM  $cp cp
-							JOIN $circ circ ON (circ.target_copy = cp.id)
-							LEFT JOIN $atc trans ON (trans.target_copy = cp.id)
-							LEFT JOIN $setting setting
-								ON (cp.circ_lib = setting.org_unit AND setting.name = 'circ.reshelving_complete.interval')
-					  WHERE circ.checkin_time IS NOT NULL
-							AND cp.status = 7
-					  GROUP BY 1
-					  HAVING (
-						( ( MAX(circ.checkin_time) > MAX(trans.dest_recv_time) or MAX(trans.dest_recv_time) IS NULL )
-						  AND MAX(circ.checkin_time) < NOW() - CAST( COALESCE( BTRIM( FIRST(setting.value),'"' ), ? )  AS INTERVAL) )
-						OR
-						( MAX(trans.dest_recv_time) > MAX(circ.checkin_time)
-						  AND MAX(trans.dest_recv_time) < NOW() - CAST( COALESCE( BTRIM( FIRST(setting.value),'"' ), ? )  AS INTERVAL) )
-					  )
-					) AS foo
-								UNION ALL
-			SELECT  cp.id
-			  FROM  $cp cp 
-					LEFT JOIN $setting setting
-						ON (cp.circ_lib = setting.org_unit AND setting.name = 'circ.reshelving_complete.interval')
-					LEFT JOIN $circ circ ON (circ.target_copy = cp.id)
-			  WHERE cp.status = 7
-					AND circ.id IS NULL
-					AND cp.create_date < NOW() - CAST( COALESCE( BTRIM( setting.value,'"' ), ? )  AS INTERVAL)
+            SELECT cp.id 
+            FROM  $cp cp
+                LEFT JOIN $setting setting
+                    ON (cp.circ_lib = setting.org_unit AND setting.name = 'circ.reshelving_complete.interval')
+            WHERE cp.status = 7
+                AND cp.status_changed_time < NOW() - CAST( COALESCE( BTRIM( setting.value,'"' ), ? )  AS INTERVAL)
 		  )
 	SQL
 	my $sth = action::circulation->db_Main->prepare_cached($sql);

-----------------------------------------------------------------------

Summary of changes:
 .../Application/Storage/Publisher/action.pm        |   35 +++----------------
 1 files changed, 6 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list