Thin 的代码/文档建议默认连接超时为 30 秒。但是,当我尝试对此进行测试时,它似乎不起作用。我错过了什么?
我正在使用瘦 v1.5.0(最新)。
# Test this using: curl -X GET http://localhost:3000/test. You will find that the request does not
# timeout after 30s.
require 'thin'
class SimpleAdapter
def call(env)
sleep 100
body = ["hello!"]
[
200,
{ 'Content-Type' => 'text/plain' },
body
]
end
end
server = Thin::Server.new('127.0.0.1', 3000) do
map '/test' do
run SimpleAdapter.new
end
end
server.start!