Bug 32247 - Real time HoldsQueue does not need to check items if there are no holds
Summary: Real time HoldsQueue does not need to check items if there are no holds
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-17 13:38 UTC by Nick Clemens
Modified: 2023-12-28 20:42 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.01,22.05.09


Attachments
Bug 32247: Exit holds queue builder if there are no holds on the biblio (3.01 KB, patch)
2022-11-17 13:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32247: Exit holds queue builder if there are no holds on the biblio (3.01 KB, patch)
2022-11-17 14:05 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32247: Exit holds queue builder if there are no holds on the biblio (3.05 KB, patch)
2022-11-17 20:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 32247: Exit holds queue builder if there are no holds on the biblio (3.11 KB, patch)
2022-12-15 12:50 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-11-17 13:38:45 UTC
update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
Comment 1 Nick Clemens 2022-11-17 13:40:46 UTC
Created attachment 143999 [details] [review]
Bug 32247: Exit holds queue builder if there are no holds on the biblio

update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
This patch simply deletes the queue for this biblio, then exits if there are no holds

To test:
prove -v t/db_dependent/Reserves.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Hold.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteItem.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t t/db_dependent/HoldsQueue.t t/db_dependent/Circulation_holdsqueue.t t/db_dependent/Biblio_holdsqueue.t t/db_dependent/Biblio.t
Comment 2 Nick Clemens 2022-11-17 14:05:11 UTC
Created attachment 144001 [details] [review]
Bug 32247: Exit holds queue builder if there are no holds on the biblio

update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
This patch simply deletes the queue for this biblio, then exits if there are no holds

To test:
prove -v t/db_dependent/Reserves.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Hold.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteItem.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t t/db_dependent/HoldsQueue.t t/db_dependent/Circulation_holdsqueue.t t/db_dependent/Biblio_holdsqueue.t t/db_dependent/Biblio.t
Comment 3 David Nind 2022-11-17 20:21:25 UTC
Created attachment 144040 [details] [review]
Bug 32247: Exit holds queue builder if there are no holds on the biblio

update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
This patch simply deletes the queue for this biblio, then exits if there are no holds

To test:
prove -v t/db_dependent/Reserves.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Hold.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteItem.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t t/db_dependent/HoldsQueue.t t/db_dependent/Circulation_holdsqueue.t t/db_dependent/Biblio_holdsqueue.t t/db_dependent/Biblio.t

Signed-off-by: David <david@davidnind.com>
Comment 4 Tomás Cohen Arazi 2022-12-15 12:50:56 UTC
Created attachment 144613 [details] [review]
Bug 32247: Exit holds queue builder if there are no holds on the biblio

update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
This patch simply deletes the queue for this biblio, then exits if there are no holds

To test:
prove -v t/db_dependent/Reserves.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Hold.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteItem.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t t/db_dependent/HoldsQueue.t t/db_dependent/Circulation_holdsqueue.t t/db_dependent/Biblio_holdsqueue.t t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi 2022-12-15 12:58:35 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 6 Martin Renvoize 2022-12-15 14:06:04 UTC
Nice work everyone!

Pushed to 22.11.x for the next release
Comment 7 Lucas Gass 2023-01-19 23:19:47 UTC
Backported to 22.05.x for upcoming 22.05.09
Comment 8 Arthur Suzuki 2023-01-26 10:39:44 UTC
update_queue_for_biblio was not defined in 21.11.x.
Not sure this patch is suitable for 21.11.x branch, won't backport.