From 42ce1d6ae69158d0626baab5566e6049e5c46c39 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Tue, 19 Nov 2024 13:54:41 +0000 Subject: [PATCH] Bug 35659: (QA follow-up) Fix DateTime and cronlogaction messages --- Koha/OAI/Client/Harvester.pm | 7 +------ misc/cronjobs/harvest_oai.pl | 5 ++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Koha/OAI/Client/Harvester.pm b/Koha/OAI/Client/Harvester.pm index 9e60214be16..ed83d3d36de 100644 --- a/Koha/OAI/Client/Harvester.pm +++ b/Koha/OAI/Client/Harvester.pm @@ -52,11 +52,6 @@ use Date::Calc qw( Today ); -my $strp = DateTime::Format::Strptime->new( - pattern => '%FT%TZ', - time_zone => 'floating', -); - our $xslt_engine = Koha::XSLT::Base->new; =head2 new @@ -136,7 +131,7 @@ sub init { # Change this to yyyy-mm-dd my ( $nowyear, $nowmonth, $nowday ) = Today(); my @date = Add_Delta_Days( $nowyear, $nowmonth, $nowday, -$days ); - my $dt_start = DateTime->new( year => $date[0], month => $date[1], day => $date[2] ); + my $dt_start = dt_from_string( $date[0] . '-' . $date[1] . '-' . $date[2] ); $start_date = $dt_start->ymd(); $self->printlog("Harvesting from $start_date"); } diff --git a/misc/cronjobs/harvest_oai.pl b/misc/cronjobs/harvest_oai.pl index 554049304ae..050232a6752 100755 --- a/misc/cronjobs/harvest_oai.pl +++ b/misc/cronjobs/harvest_oai.pl @@ -99,14 +99,13 @@ try { exit; }; -cronlogaction( { action => 'Start', info => "Starting OAI Harvest" } ); -cronlogaction( { info => "Command line: $command_line_options" } ); +cronlogaction( { info => $command_line_options } ); my $harvester = Koha::OAI::Client::Harvester->new( { server => $server, days => $days, force => $force, logger => \&logFunction } ); $harvester->init(); -cronlogaction( { action => 'End', info => "Ending OAI Harvest" } ); +cronlogaction( { action => 'End', info => "COMPLETED" } ); sub logFunction { my $message = shift; -- 2.39.5