2
代碼/薄文檔建議的默認連接超時是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!
你能引用表明30秒超時的文檔? – udoprog
如果你在看代碼,DEFAULT_TIMEOUT設置爲30秒。另外,如果你使用命令行亞軍和做「薄-h」,則幫助提出以下建議:「-t,--timeout SEC請求或命令超時,以秒(默認值:30)」。 – Kowshik