Bugzilla – Attachment 173219 Details for
Bug 38237
Add logging to erm_run_harvester cronjob
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38237: Add logging to erm_run_harvester cronjob
Bug-38237-Add-logging-to-ermrunharvester-cronjob.patch (text/plain), 2.01 KB, created by
Pedro Amorim
on 2024-10-23 14:26:54 UTC
(
hide
)
Description:
Bug 38237: Add logging to erm_run_harvester cronjob
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-23 14:26:54 UTC
Size:
2.01 KB
patch
obsolete
>From 6b17ba67955f68d9b32d990f4913873f5238e86a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 23 Oct 2024 12:22:16 +0000 >Subject: [PATCH] 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> >--- > misc/cronjobs/erm_run_harvester.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/misc/cronjobs/erm_run_harvester.pl b/misc/cronjobs/erm_run_harvester.pl >index fa8f0b3828..f637d43166 100755 >--- a/misc/cronjobs/erm_run_harvester.pl >+++ b/misc/cronjobs/erm_run_harvester.pl >@@ -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) = @_; > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38237
:
173211
|
173212
| 173219 |
173220