add timeout on reconnect
This commit is contained in:
parent
ce97d7e532
commit
f7ed81c6aa
1 changed files with 5 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# $Dwarf: article.rb,v 1.80 2003/11/12 14:01:43 ward Exp $
|
# $Dwarf: article.rb,v 1.81 2004/05/19 09:55:12 ward Exp $
|
||||||
# $Source$
|
# $Source$
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -66,8 +66,10 @@ def reconnect(server)
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
sleep 3
|
sleep 3
|
||||||
@connections[server]["nntp"] = Net::NNTP.new(server)
|
timeout(180) do
|
||||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT
|
@connections[server]["nntp"] = Net::NNTP.new(server)
|
||||||
|
end
|
||||||
|
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
|
||||||
print "Reconnect to #{server} failed: #{$!}\n"
|
print "Reconnect to #{server} failed: #{$!}\n"
|
||||||
del_server(server)
|
del_server(server)
|
||||||
raise PermError, "Couldn't connect to #{server}"
|
raise PermError, "Couldn't connect to #{server}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue