[Koha-bugs] [Bug 29346] Add option for building the holds queue for a single bib in background

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 24 20:57:30 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29346

--- Comment #2 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 131088
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131088&action=edit
Bug 29346: Refactor loop code into a subroutine

The CreateQueue() method deletes the holds queue data, fetches some
configuration (branches to use, transport cost matrix) and then loops
through a list of biblionumbers, generating the tmp_holdsqueue and
hold_fill_targets rows for the specified biblio.

This patch simply moves that last bit that is run inside the biblios
loop into a separate sub.

The update_queue_for_biblio sub is designed so it does the exact same
thing it did inside the loop, but also gets added the capability of
querying those parameters if not passed, and it also gets a 'delete'
parameter so it deletes the biblio-specific holds queue rows before
starting to work.

This way, it can be reused to write a background job for real-time holds
queue update :-D

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/HoldsQueue.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass! Behavior is kept!
4. Sign off :-D

Sponsored-by: Montgomery County Public Libraries

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list