Bugzilla – Attachment 185349 Details for
Bug 40636
C4::Reserves::CancelExpiredReserves behavior depends on date it is run
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40636: (follow-up) Cache the calendar object
Bug-40636-follow-up-Cache-the-calendar-object.patch (text/plain), 1.23 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-12 17:48:06 UTC
(
hide
)
Description:
Bug 40636: (follow-up) Cache the calendar object
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-12 17:48:06 UTC
Size:
1.23 KB
patch
obsolete
>From 54339d2ecb5affa5bfe7eacf8cd644eb568e27b6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 12 Aug 2025 14:46:38 -0300 >Subject: [PATCH] Bug 40636: (follow-up) Cache the calendar object > >--- > C4/Reserves.pm | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 8d467d7d4a6..8b706e500ce 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1070,8 +1070,15 @@ sub CancelExpiredReserves { > # FIXME To move to Koha::Holds->search_expired (?) > my $holds = Koha::Holds->search($params); > >+ my $cache = Koha::Cache::Memory::Lite->get_instance(); >+ > while ( my $hold = $holds->next ) { >- my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); >+ my $cache_key = sprintf "Calendar_CancelExpiredReserves:%s", $hold->branchcode; >+ my $calendar = $cache->get_from_cache($cache_key); >+ if ( !$calendar ) { >+ $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); >+ $cache->set_in_cache( $cache_key, $calendar ); >+ } > > # Get the actual expiration date for this hold > my $expiration_date = $hold->expirationdate || $hold->patron_expiration_date; >-- >2.50.1
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 40636
:
185346
|
185347
|
185348
|
185349
|
185350
|
185351
|
185352
|
185353
|
185411
|
185412
|
185413
|
185414