Bug 34587: Fix dry run and end date in the cronjob

The cronjob always logs a dry run even on a live harvest and the end date parameter was not working correctly. This patch addresses both issues

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-09-20 14:57:14 +00:00 committed by Tomas Cohen Arazi
parent d4afc38c7c
commit cd2a642c31
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ unless ($begin_date) {
die "ERROR: Please specify a begin-date";
}
debug_msg("Dry run: Harvests will not be enqueued");
debug_msg("Dry run: Harvests will not be enqueued") if $dry_run;
while ( my $udprovider = $udproviders->next ) {
debug_msg(
sprintf(
@ -63,7 +63,7 @@ while ( my $udprovider = $udproviders->next ) {
);
my $harvest_begin_date = dt_from_string($begin_date);
my $harvest_end_date = $end_date || dt_from_string();
my $harvest_end_date = dt_from_string($end_date) || dt_from_string();
if ( $harvest_begin_date > $harvest_end_date ) {
die sprintf(