mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 02:24:54 +08:00
correct it so stats socket times out after 10 seconds
This commit is contained in:
parent
20778fbf58
commit
e189ec2def
@ -38,8 +38,10 @@ class StatsSocket
|
||||
return false
|
||||
end
|
||||
|
||||
line = socket.readline
|
||||
socket.write get_response(line.strip)
|
||||
if IO.select(nil, [socket], nil, 10)
|
||||
line = socket.read_nonblock(1000)
|
||||
socket.write get_response(line.strip)
|
||||
end
|
||||
socket.close
|
||||
true
|
||||
rescue IOError
|
||||
|
Loading…
x
Reference in New Issue
Block a user