[Koha-bugs] [Bug 20750] Allow timestamped auditing of ILL request events
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Feb 28 12:20:47 CET 2019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20750
Josef Moravec <josef.moravec at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #85701|0 |1
is obsolete| |
--- Comment #118 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 85833
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85833&action=edit
Bug 20750: (follow-up) Remove Time::Piece dep
The sorting of log entries was being achieved using Time::Piece::epoch
to derive the epoch date from the log timestamps. Time::Piece is not
used anywhere else, therefore it was desirable to find an alternative
method that uses a library that is already in use in Koha.
It would have been possible to use Koha::DateUtils::dt_from_string to do
this, however, this function instantiates a DateTime object to do the
conversion. DateTime objects are notoriously slow at instantiating, so
for this use case where we're potentially converting a lot, it didn't
seem ideal. Besides, dt_from_string is built to convert from a variety
of formats, but since our timestamps are in a defined format, this seems
overkill.
In the end, we're using Time::Local::timelocal to obtain the epoch time.
Time::Local is in use elsewhere and doesn't depend on DateTime.
Also updated the unit test of get_request_logs, it was using the wrong
date format anyway!
Signed-off-by: Josef Moravec <josef.moravec at gmail.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list