]> cat aescling's git repositories - mastodon.git/commitdiff
Do not set port for puma if it is bound to unix socket (#2289)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Fri, 21 Apr 2017 23:22:20 +0000 (08:22 +0900)
committerEugen <eugen@zeonfederated.com>
Fri, 21 Apr 2017 23:22:20 +0000 (01:22 +0200)
Setting port after binding a unix socket puma listen to both of an unix
socket and TCP/IP, which is not a desired behavior.

config/puma.rb

index eb8fc6a8e9b636c6dd972d603feb8c9f2d18dbce..0397b892048588048784cf95181d61d560f4ed05 100644 (file)
@@ -3,9 +3,10 @@ threads threads_count, threads_count
 
 if ENV['SOCKET'] then
   bind 'unix://' + ENV['SOCKET']
+else
+  port ENV.fetch('PORT') { 3000 }
 end
 
-port        ENV.fetch('PORT') { 3000 }
 environment ENV.fetch('RAILS_ENV') { 'development' }
 workers     ENV.fetch('WEB_CONCURRENCY') { 2 }