[koha-commits] main Koha release repository branch 3.18.x updated. v3.18.09-3-g5e58767
Git repo owner
gitmaster at git.koha-community.org
Tue Aug 4 03:04:40 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".
The branch, 3.18.x has been updated
via 5e587672d2601c34326c81e888512b67008ec971 (commit)
via e81c07bd5161b6966897d207a04f37e782066469 (commit)
from 6d6c6c1d9f3ab7126415d9695068656b9e98ccb9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5e587672d2601c34326c81e888512b67008ec971
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Mon Jul 6 14:20:07 2015 +0200
Bug 14494: Terribly slow checkout caused by DateTime->new in far future
An expiry date like 9999-12-31 in the local timezone will make DateTime
spend a lot of time (maybe 60 seconds) on date calculation. See the
DateTime documention on CPAN.
A calculation in floating (or alternatively in UTC) would only take
a few milliseconds.
This patch makes two changes in this regard:
[1] The compare between expiry date and today in CanBookBeIssued has been
adjusted in Jonathan's patch. I am moving the compare to the floating
timezone (as was done in my original patch). This removes a hardcoded
9999.
[2] If ReturnBeforeExpiry is enabled, CalcDateDue compares the normal due
date with the expiry date. The comparison is now done in the floating
timezone. If the expiry date is before the due date, it is
returned in the user context's timezone.
NOTE: The calls to set_time_zone moving to or from floating do not adjust
the local time.
TEST PLAN:
First without this patch (and the one from Jonathan):
[1] Set expiry date to 9999-12-31 for a patron.
[2] Enable ReturnBeforeExpiry.
[3] Checkout a book to this patron. This will be (very) slow.
Continue now with this patch applied:
[4] Check in the same book.
[5] Check it out again. Should be much faster.
Bonus test:
[6] Set borrower expiry date to today. Change relevant circulation rule
to loan period of 21 hours. Test checking out with a manual due date
/time just before today 23:59 and after that. In the second case the
due date/time should become today 23:59 (note that 23:59 is not
shown on the checkout form).
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit 17d04c46190880d3031adbc02553f82234d70fc1)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
Signed-off-by: Liz Rea <wizzyrea at gmail.com>
commit e81c07bd5161b6966897d207a04f37e782066469
Author: Jonathan Druart <jonathan.druart at koha-community.org>
Date: Thu Jul 9 09:52:28 2015 +0100
Bug 14494: Prevent slow checkout if the patron does not have an expiry date
If a patron has a expiry date set to 9999-12-31 (for organizations for
instance), the checkouts are very slow.
It's caused by 2 different calls to DateTime in CanBookBeIssued:
1/
DateTime->new( year => 9999, month => 12, day => 31, time_zone => C4::Context->tz );
The time_zone should not be set (as it's done in Koha::DateUtils), set to UTC or floating tz.
2/
DateTime->compare($today, $expiry_dt)
The comparaison of 2 DT with 1 related to 9999 is very slow, as you can
imagine.
For 1/ we need to call Koha::DateUtils::dt_from_string (actually, we
should never call DateTime directly).
For 2/ we just need to test if the date is != 9999, no need to compare
it in this case.
Test plan:
Before this patch, confirm that the checkouts are slow if the patron has a
dateexpiry set to 9999-12-31.
update borrowers set dateexpiry="9999-12-31" where borrowernumber=42;
After this patch, you should not see any regression when checking out
items to an expired patron and to a valid patron.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit 8d58acc565c8500d4b9d55cacb3d6d21628a899b)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
Signed-off-by: Liz Rea <wizzyrea at gmail.com>
-----------------------------------------------------------------------
Summary of changes:
C4/Circulation.pm | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
hooks/post-receive
--
main Koha release repository
More information about the koha-commits
mailing list