try {
if ($one_hold) {
+ $self->method_lookup('open-ils.storage.transaction.begin')->run( $client );
$holds = [ action::hold_request->search_where( { id => $one_hold, fulfillment_time => undef, cancel_time => undef } ) ];
} elsif ( $check_expire ) {
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 or $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");
$self->method_lookup('open-ils.storage.transaction.begin')->run( $client );
$log->info("Processing hold ".$hold->id."...\n");
+ #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 or $hold->capture_time);
+
# remove old auto-targeting maps
my @oldmaps = action::hold_copy_map->search( hold => $hold->id );
$_->delete for (@oldmaps);