From cdc6306f6b3ece1abd6430ccfa99482b547d9c9d Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 22 Feb 2018 22:43:30 +0000 Subject: [PATCH] support for multiples of the same action in schedule config --- Changes | 11 ++++++++++- lib/App/Netdisco/Backend/Role/Scheduler.pm | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 0ec746a0..d07a72c2 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +2.039010 - + + [NEW FEATURES] + + * support for multiples of the same action in schedule config + 2.039009 - 2018-02-22 [NEW FEATURES] @@ -10,10 +16,13 @@ [ENHANCEMENTS] - * handle malformed IPs in c_ip results * larger port status icons in Device Ports view * --quiet mode for netdisco-do + [BUG FIXES] + + * handle malformed IPs in c_ip results + 2.039007 - 2018-02-16 [ENHANCEMENTS] diff --git a/lib/App/Netdisco/Backend/Role/Scheduler.pm b/lib/App/Netdisco/Backend/Role/Scheduler.pm index 0e4d9ec6..f7316d5c 100644 --- a/lib/App/Netdisco/Backend/Role/Scheduler.pm +++ b/lib/App/Netdisco/Backend/Role/Scheduler.pm @@ -62,16 +62,17 @@ sub worker_body { foreach my $action (keys %{ setting('schedule') }) { my $sched = setting('schedule')->{$action} or next; + my $real_action = ($sched->{action} || $action); # next occurence of job must be in this minute's window - debug sprintf "sched ($wid): $action: win_start: %s, win_end: %s, next: %s", + debug sprintf "sched ($wid): $real_action: win_start: %s, win_end: %s, next: %s", $win_start, $win_end, $sched->{when}->next_time($win_start); next unless $sched->{when}->next_time($win_start) <= $win_end; # queue it! - info "sched ($wid): queueing $action job"; + info "sched ($wid): queueing $real_action job"; jq_insert({ - action => $action, + action => $real_action, device => $sched->{device}, port => $sched->{port}, extra => $sched->{extra},