From 71aa26173736ebf323c141ed8398b0123f50cb80 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 15 Jul 2023 10:14:01 +0100 Subject: [PATCH] fix skip long SNMP timeout for initial discover --- lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm b/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm index 7a9818f1..901b0e0a 100644 --- a/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm +++ b/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm @@ -4,11 +4,15 @@ use Dancer ':syntax'; use App::Netdisco::Worker::Plugin; use aliased 'App::Netdisco::Worker::Status'; +use Scalar::Util 'blessed'; + register_worker({ phase => 'check', driver => 'direct' }, sub { my ($job, $workerconf) = @_; # if the job is a queued job, and discover, and the first one... - if ($job->job and $job->action eq 'discover' and not $job->log) { + if ($job->job and $job->action eq 'discover' and not $job->log + and (not blessed $job->device or not $job->device->in_storage)) { + config->{'snmp_try_slow_connect'} = false; debug sprintf '[%s] skipping long SNMP timeouts for initial discover', $job->device;