1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Merge pull request #1716 from mdkent/min-worker_timeout

Min worker timeout
This commit is contained in:
Evan Phoenix 2019-02-20 09:28:37 -08:00 committed by GitHub
commit 0b15d4ff6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -176,7 +176,8 @@
# the given timeout. If not the worker process will be restarted. This is
# not a request timeout, it is to protect against a hung or dead process.
# Setting this value will not protect against slow requests.
# Default value is 60 seconds.
#
# The minimum value is 6 seconds, the default value is 60 seconds.
#
# worker_timeout 60

View file

@ -451,6 +451,13 @@ module Puma
# that have not checked in within the given +timeout+.
# This mitigates hung processes. Default value is 60 seconds.
def worker_timeout(timeout)
timeout = Integer(timeout)
min = Cluster::WORKER_CHECK_INTERVAL
if timeout <= min
raise "The minimum worker_timeout must be greater than the worker reporting interval (#{min})"
end
@options[:worker_timeout] = Integer(timeout)
end