add option to disable max_deferrals
This commit is contained in:
		| @@ -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. | ||||
|  | ||||
| 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 | ||||
|  | ||||
| sub skipped { | ||||
|   my ($rs, $backend, $max_deferrals) = @_; | ||||
|   $backend ||= (hostfqdn || 'localhost'); | ||||
|   $max_deferrals ||= 10; | ||||
|   $max_deferrals ||= 10_000_000; # not really 'disabled' | ||||
|  | ||||
|   return $rs->correlate('device_skips')->search(undef, { | ||||
|     # NOTE: bind param list order is significant | ||||
|     bind => [[deferrals => $max_deferrals], [backend => $backend]], | ||||
|   }); | ||||
| } | ||||
|   | ||||
| @@ -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 | ||||
| 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> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user