regression in hold targeting where blanket expire_time is set
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 3 Jun 2009 00:52:36 +0000 (00:52 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 3 Jun 2009 00:52:36 +0000 (00:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13294 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm

index 5b178ce..939a0bd 100644 (file)
@@ -892,9 +892,11 @@ sub new_hold_copy_targeter {
 
                        if ($hold->expire_time) {
                                my $ex_time = $parser->parse_datetime( clense_ISO8601( $hold->expire_time ) );
-                               $hold->update( { cancel_cause => 1, cancel_time => 'now' } ) if ( DateTime->compare($ex_time, DateTime->now) < 0 );
-                               $self->method_lookup('open-ils.storage.transaction.commit')->run;
-                               die "OK\n";
+                if ( DateTime->compare($ex_time, DateTime->now) < 0 ) {
+                  $hold->update( { cancel_time => 'now' } );
+                  $self->method_lookup('open-ils.storage.transaction.commit')->run;
+                  die "OK\n";
+                }
                        }
 
                        my $all_copies = [];