Add timeouts to the retry category, helps with the nexpose instance is heavily loaded

git-svn-id: file:///home/svn/framework3/trunk@9604 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-06-24 03:43:32 +00:00
parent 48732165f3
commit 9c0bcb4bad
1 changed files with 7 additions and 1 deletions

View File

@ -140,7 +140,13 @@ class APIRequest
@conn_tries += 1 @conn_tries += 1
retry retry
end end
rescue ::Timeout::Error, ::Errno::EHOSTUNREACH,::Errno::ENETDOWN,::Errno::ENETUNREACH,::Errno::ENETRESET,::Errno::EHOSTDOWN,::Errno::EACCES,::Errno::EINVAL,::Errno::EADDRNOTAVAIL rescue ::Timeout::Error
if @conn_tries < 5
@conn_tries += 1
retry
end
@error = "NeXpose host did not respond"
rescue ::Errno::EHOSTUNREACH,::Errno::ENETDOWN,::Errno::ENETUNREACH,::Errno::ENETRESET,::Errno::EHOSTDOWN,::Errno::EACCES,::Errno::EINVAL,::Errno::EADDRNOTAVAIL
@error = "NeXpose host is unreachable" @error = "NeXpose host is unreachable"
# Handle console-level interrupts # Handle console-level interrupts
rescue ::Interrupt rescue ::Interrupt