From 45475418aa5843cf2be9dddd421468a58b2b5940 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 26 Oct 2006 07:03:12 +0000 Subject: [PATCH] adding capture time recheck to targeter git-svn-id: svn://svn.open-ils.org/ILS/trunk@6513 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Storage/Publisher/action.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 770f0d6fb1..610b4c4ddf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -737,6 +737,10 @@ sub new_hold_copy_targeter { for my $hold (@$holds) { try { + #first, re-fetch the hold, to make sure it's not captured already + $hold = action::hold_request->retrieve( $hold->id ); + die "OK\n" if ($hold->capture_time); + #start a transaction if needed if ($self->method_lookup('open-ils.storage.transaction.current')->run) { $log->debug("Cleaning up after previous transaction\n"); @@ -783,7 +787,7 @@ sub new_hold_copy_targeter { unless ($rtree) { push @successes, { hold => $hold->id, eligible_copies => 0, error => 'NO_RECORD' }; - die 'OK'; + die "OK\n"; } for my $cn ( @{ $rtree->call_numbers } ) { @@ -819,7 +823,7 @@ sub new_hold_copy_targeter { $hold->update( { prev_check_time => 'today' } ); $self->method_lookup('open-ils.storage.transaction.commit')->run; - die 'OK'; + die "OK\n"; } my $copy_count = @$all_copies; @@ -874,7 +878,7 @@ sub new_hold_copy_targeter { $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'; + die "OK\n"; } } -- 2.11.0