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
|
||||
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…
Add table
Add a link
Reference in a new issue