[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
Mon Jan 21 15:25:12 CET 2019


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

--- Comment #46 from Andrew Isherwood <andrew.isherwood at ptfs-europe.com> ---
Created attachment 84266
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84266&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!

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


More information about the Koha-bugs mailing list