目前,我正在以编程方式在我的程序中生成HTTP服务器。
srv = Thin::Server.start('0.0.0.0', 3000, app)
我无法弄清楚我应该在哪里看到更改保持活动时间设置。因为瘦服务器不会立即死亡,所以在调试和开发应用程序时困扰我。我会打开保持活着的生产,但我仍然希望控制持续时间。
答案 0 :(得分:1)
答案 1 :(得分:0)
# Thin::Server.stop! doesn't work immediately if there's live keep-alive connection.
# SIGINT doesn't work.
# Only SIGKILL works.
# But `abort` is a lot quicker way.
# Overridden to abort.
trap("INT") { puts " Force quit by raising intentional crash!" ;abort() }