mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
correct it so stats socket times out after 10 seconds
This commit is contained in:
parent
20778fbf58
commit
e189ec2def
1 changed files with 4 additions and 2 deletions
|
@ -38,8 +38,10 @@ class StatsSocket
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
line = socket.readline
|
if IO.select(nil, [socket], nil, 10)
|
||||||
socket.write get_response(line.strip)
|
line = socket.read_nonblock(1000)
|
||||||
|
socket.write get_response(line.strip)
|
||||||
|
end
|
||||||
socket.close
|
socket.close
|
||||||
true
|
true
|
||||||
rescue IOError
|
rescue IOError
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue