set prev_check_time to midnight of today when there are 0 eligible copies
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Sep 2006 05:31:38 +0000 (05:31 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Sep 2006 05:31:38 +0000 (05:31 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5948 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 87824b3..b1961f1 100644 (file)
@@ -755,6 +755,9 @@ sub new_hold_copy_targeter {
                                $log->info("\tNo copies available for targeting at all!\n");
                                $self->method_lookup('open-ils.storage.transaction.commit')->run;
                                push @successes, { hold => $hold->id, eligible_copies => 0, error => 'NO_COPIES' };
+
+                               $hold->update( { prev_check_time => 'today' } );
+                               $self->method_lookup('open-ils.storage.transaction.commit')->run;
                                die 'OK';
                        }
 
@@ -808,6 +811,7 @@ sub new_hold_copy_targeter {
                                        push @good_copies, $old_best;
                                } else {
                                        $log->debug("\tcurrent_copy is no longer available for targeting... NEXT HOLD, PLEASE!");
+                                       $hold->update( { prev_check_time => 'today' } );
                                        $self->method_lookup('open-ils.storage.transaction.commit')->run;
                                        push @successes, { hold => $hold->id, eligible_copies => 0, error => 'NO_TARGETS' };
                                        die 'OK';