Subject: | Feature Request (w/ diff) |
First off, great wildly useful module, but I had a suggestion.
It would be useful if, after each job is dispatched, a warning is logged
if that job's return value is not zero (as most unix utilities return on
success).
As such, I've modified my own copy to have this functionality, if a
'checkreturn' flag is set to true. I've attached a diff of said changes.
Again, great module.
Subject: | Schedule-Cron.diff |
199a200,205
> =item checkreturn => 1
>
> Check return value of each job. This will log a warning-level message if a
> job returns any value not equal to zero. This is useful only when every job
> normally returns zero on success, similar to most unix utilities.
>
1065a1072
> my $dispatch_result;
1071c1078
< &$dispatch(@args);
---
> $dispatch_result = &$dispatch(@args);
1082c1089,1095
< &$dispatch(@args);
---
> $dispatch_result = &$dispatch(@args);
> }
>
> if($cfg->{checkreturn}) {
> if($dispatch_result != 0) {
> $log->(1,"Schedule::Cron - Nonsuccess return value from job $index: $dispatch_result");
> }