Skip to content

A platform for community discussion. Free, open, simple.

DEV: Give more time to pitchfork workers to spawn (#37405)

Loïc Guitautd50ec29f92a4
diff --git a/config/pitchfork.conf.rb b/config/pitchfork.conf.rb
index d8e7b2033c6..4535312e7a0 100644
--- a/config/pitchfork.conf.rb
+++ b/config/pitchfork.conf.rb
@@ -22,13 +22,16 @@ worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
# stree-ignore
listen ENV["UNICORN_LISTENER"] || "#{(ENV["UNICORN_BIND_ALL"] ? "" : "127.0.0.1:")}#{(ENV["UNICORN_PORT"] || 3000).to_i}", reuseport: true
-if ENV["RAILS_ENV"] == "production"
- # nuke workers after 30 seconds instead of 20 seconds (the default)
- timeout 30
-else
- # we want a longer timeout in dev cause first request can be really slow
- timeout(ENV["UNICORN_TIMEOUT"] && ENV["UNICORN_TIMEOUT"].to_i || 60)
-end
+timeout =
+ (
+ if ENV["RAILS_ENV"] == "production"
+ 30
+ else
+ ENV["UNICORN_TIMEOUT"] && ENV["UNICORN_TIMEOUT"].to_i || 60
+ end
+ )
+timeout(timeout)
+spawn_timeout(timeout) # Allow workers more than 10 seconds to spawn
check_client_connection false