add option to disable max_deferrals

This commit is contained in:
Oliver Gorwits
2017-05-28 09:31:57 +01:00
parent 666e0a593d
commit 9ac2662182
2 changed files with 5 additions and 3 deletions

View File

@@ -18,16 +18,17 @@ Retuns a correlated subquery for the set of C<device_skip> entries that apply
to some jobs. They match the device IP, current backend, and job action. to some jobs. They match the device IP, current backend, and job action.
Pass the C<backend> FQDN (or the current host will be used as a default), and Pass the C<backend> FQDN (or the current host will be used as a default), and
the C<max_deferrals> (or 10 will be used as the default). the C<max_deferrals> (option disabled if 0/undef value is passed).
=cut =cut
sub skipped { sub skipped {
my ($rs, $backend, $max_deferrals) = @_; my ($rs, $backend, $max_deferrals) = @_;
$backend ||= (hostfqdn || 'localhost'); $backend ||= (hostfqdn || 'localhost');
$max_deferrals ||= 10; $max_deferrals ||= 10_000_000; # not really 'disabled'
return $rs->correlate('device_skips')->search(undef, { return $rs->correlate('device_skips')->search(undef, {
# NOTE: bind param list order is significant
bind => [[deferrals => $max_deferrals], [backend => $backend]], bind => [[deferrals => $max_deferrals], [backend => $backend]],
}); });
} }

View File

@@ -1315,7 +1315,8 @@ to avoid a 'runaway worker' bug. It can take a fractional number of seconds.
C<max_deferrals> is the number of times an SNMP connect failure can occur C<max_deferrals> is the number of times an SNMP connect failure can occur
before the device is no longer polled. The setting and counters are local to before the device is no longer polled. The setting and counters are local to
each poller backend. To reset device counters, restart the backend daemon. each poller backend. To reset device counters, restart the backend daemon. To
disable this feature configure the setting with a value of zero.
=head3 C<schedule> =head3 C<schedule>