Allow default schedule items to be skipped by setting to 'null'
This commit is contained in:
@@ -20,7 +20,8 @@ sub worker_begin {
|
||||
debug "entering Scheduler ($wid) worker_begin()";
|
||||
|
||||
foreach my $action (keys %{ setting('schedule') }) {
|
||||
my $config = setting('schedule')->{$action};
|
||||
my $config = setting('schedule')->{$action}
|
||||
or next;
|
||||
|
||||
# accept either single crontab format, or individual time fields
|
||||
$config->{when} = Algorithm::Cron->new(
|
||||
@@ -59,7 +60,8 @@ sub worker_body {
|
||||
|
||||
# if any job is due, add it to the queue
|
||||
foreach my $action (keys %{ setting('schedule') }) {
|
||||
my $sched = setting('schedule')->{$action};
|
||||
my $sched = setting('schedule')->{$action}
|
||||
or next;
|
||||
|
||||
# next occurence of job must be in this minute's window
|
||||
debug sprintf "sched ($wid): $action: win_start: %s, win_end: %s, next: %s",
|
||||
|
||||
18
lib/App/Netdisco/Worker/Plugin/DumpConfig.pm
Normal file
18
lib/App/Netdisco/Worker/Plugin/DumpConfig.pm
Normal file
@@ -0,0 +1,18 @@
|
||||
package App::Netdisco::Worker::Plugin::DumpConfig;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use App::Netdisco::Worker::Plugin;
|
||||
use aliased 'App::Netdisco::Worker::Status';
|
||||
|
||||
use Data::Printer;
|
||||
|
||||
register_worker({ phase => 'main' }, sub {
|
||||
my ($job, $workerconf) = @_;
|
||||
my $extra = $job->extra;
|
||||
|
||||
my $config = config();
|
||||
p ($extra ? $config->{$extra} : $config);
|
||||
return Status->done('Dumped config');
|
||||
});
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user