Bugzilla – Attachment 161359 Details for
Bug 35899
Performance improvements for build_holds_queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35899: don't perform expensive checks on non-local items when examining local items
Bug-35899-dont-perform-expensive-checks-on-non-loc.patch (text/plain), 2.89 KB, created by
Andreas Jonsson
on 2024-01-24 19:38:41 UTC
(
hide
)
Description:
Bug 35899: don't perform expensive checks on non-local items when examining local items
Filename:
MIME Type:
Creator:
Andreas Jonsson
Created:
2024-01-24 19:38:41 UTC
Size:
2.89 KB
patch
obsolete
>From ca7c8f3ca46d6dce541acd0f903581fd76aecf07 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Tue, 23 Jan 2024 10:09:05 +0100 >Subject: [PATCH] Bug 35899: don't perform expensive checks on non-local items > when examining local items > >--- > C4/HoldsQueue.pm | 34 ++++++++++++++++++++++------------ > 1 file changed, 22 insertions(+), 12 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 5e555f4f95..e554b1257e 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -434,22 +434,12 @@ sub MapItemsToHoldRequests { > my $LocalHoldsPriorityItemControl = > C4::Context->preference('LocalHoldsPriorityItemControl'); > >+ REQUEST: > foreach my $request (@$hold_requests) { >+ my $patron; > last if $num_items_remaining == 0; >- my $patron = Koha::Patrons->find($request->{borrowernumber}); >- next if $patron->category->exclude_from_local_holds_priority; >- > my $local_hold_match; > foreach my $item (@$available_items) { >- next if $item->{_object}->exclude_from_local_holds_priority; >- >- next unless _checkHoldPolicy($item, $request); >- >- next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; >- >- next if $request->{item_group_id} && $item->{_object}->item_group && $item->{_object}->item_group->id ne $request->{item_group_id}; >- >- next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); > > my $local_holds_priority_item_branchcode = > $item->{$LocalHoldsPriorityItemControl}; >@@ -466,6 +456,26 @@ sub MapItemsToHoldRequests { > $local_holds_priority_patron_branchcode; > > if ($local_hold_match) { >+ next if $item->{_object}->exclude_from_local_holds_priority; >+ >+ if ( !defined $patron ) { >+ $patron = Koha::Patrons->find( $request->{borrowernumber} ); >+ >+ next REQUEST if $patron->category->exclude_from_local_holds_priority; >+ } >+ >+ next unless _checkHoldPolicy( $item, $request ); >+ >+ next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; >+ >+ next >+ if $request->{item_group_id} >+ && $item->{_object}->item_group >+ && $item->{_object}->item_group->id ne $request->{item_group_id}; >+ >+ next >+ unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); >+ > if ( exists $items_by_itemnumber{ $item->{itemnumber} } > and not exists $allocated_items{ $item->{itemnumber} } > and not $request->{allocated}) >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35899
:
161358
|
161359
|
161360
|
164969
|
164970