code tidy
This commit is contained in:
@@ -11,13 +11,13 @@ use namespace::clean;
|
||||
|
||||
my $jobactions = {
|
||||
map {$_ => undef} qw/
|
||||
discoverall
|
||||
refresh
|
||||
macwalk
|
||||
arpwalk
|
||||
nbtwalk
|
||||
backup
|
||||
/
|
||||
# discoverall
|
||||
# refresh
|
||||
# macwalk
|
||||
# arpwalk
|
||||
# nbtwalk
|
||||
# backup
|
||||
};
|
||||
|
||||
sub worker_begin {
|
||||
@@ -60,10 +60,12 @@ sub worker_body {
|
||||
next unless defined $jobactions->{$a};
|
||||
my $sched = $jobactions->{$a};
|
||||
|
||||
if ($sched->{when}->next_time($win_start) < $win_end) {
|
||||
# next occurence of job must be in this minute's window
|
||||
next unless $sched->{when}->next_time($win_start) < $win_end;
|
||||
|
||||
# queue it!
|
||||
# due to a table constraint, this will fail if a similar job is
|
||||
# already queued.
|
||||
# due to a table constraint, this will (intentionally) fail if a
|
||||
# similar job is already queued.
|
||||
try {
|
||||
debug "scheduler ($wid): queueing $a job";
|
||||
schema('netdisco')->resultset('Admin')->create({
|
||||
@@ -76,6 +78,5 @@ sub worker_body {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user