Bug 38237: Add logging to erm_run_harvester cronjob
This patch simply adds logging to the cronjob
To test:
1 - Enable CronjobLog
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CronjobLog
2 - Enable ERMModule
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ERMModule
3 - Home -> E-resource Management -> Data providers -> New data provider
Fill from registry or create your own, but change the URL and put in any required numbers
We don't need a real test, just to run the ob
4 - perl misc/cronjobs/erm_run_harvester.pl --begin-date 2024-01-01 --dry-run --debug
5 - View the logs, no log of the script
6 - Apply patches
7 - Run the job again
8 - Check logs
9 - Success!
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6ce5df7f8e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
e890457245
commit
3bdb9a9624
|
|
@ -22,9 +22,12 @@ use Getopt::Long qw( GetOptions );
|
|||
use Koha::DateUtils qw( dt_from_string );
|
||||
use POSIX;
|
||||
|
||||
use C4::Log qw( cronlogaction );
|
||||
use Koha::Script;
|
||||
use Koha::ERM::EUsage::UsageDataProviders;
|
||||
|
||||
my $command_line_options = join(" ",@ARGV);
|
||||
|
||||
# Command line option values
|
||||
my $get_help = 0;
|
||||
my $begin_date = 0;
|
||||
|
|
@ -54,6 +57,7 @@ unless ($begin_date) {
|
|||
die "ERROR: Please specify a begin-date";
|
||||
}
|
||||
|
||||
cronlogaction({ info => $command_line_options });
|
||||
debug_msg("Dry run: Harvests will not be enqueued") if $dry_run;
|
||||
while ( my $udprovider = $udproviders->next ) {
|
||||
debug_msg(
|
||||
|
|
@ -94,6 +98,8 @@ while ( my $udprovider = $udproviders->next ) {
|
|||
|
||||
}
|
||||
|
||||
cronlogaction({ action => 'End', info => "COMPLETED" });
|
||||
|
||||
sub debug_msg {
|
||||
my ($msg) = @_;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue