about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch')
-rw-r--r--nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch b/nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch
new file mode 100644
index 000000000000..88ebc1337487
--- /dev/null
+++ b/nixpkgs/pkgs/servers/web-apps/discourse/unicorn_logging_and_timeout.patch
@@ -0,0 +1,25 @@
+diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb
+index e69979adfe..68cb04a036 100644
+--- a/config/unicorn.conf.rb
++++ b/config/unicorn.conf.rb
+@@ -27,18 +27,10 @@ pid (ENV["UNICORN_PID_PATH"] || "#{discourse_path}/tmp/pids/unicorn.pid")
+ 
+ if ENV["RAILS_ENV"] != "production"
+   logger Logger.new(STDOUT)
+-  # we want a longer timeout in dev cause first request can be really slow
+-  timeout (ENV["UNICORN_TIMEOUT"] && ENV["UNICORN_TIMEOUT"].to_i || 60)
+-else
+-  # By default, the Unicorn logger will write to stderr.
+-  # Additionally, some applications/frameworks log to stderr or stdout,
+-  # so prevent them from going to /dev/null when daemonized here:
+-  stderr_path "#{discourse_path}/log/unicorn.stderr.log"
+-  stdout_path "#{discourse_path}/log/unicorn.stdout.log"
+-  # nuke workers after 30 seconds instead of 60 seconds (the default)
+-  timeout 30
+ end
+ 
++timeout (ENV["UNICORN_TIMEOUT"] && ENV["UNICORN_TIMEOUT"].to_i || 60)
++
+ # important for Ruby 2.0
+ preload_app true
+