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

configuration: allow empty tags to mean no tag desired

This allows you to use `tag ""` in the config file to avoid
inferring a tag.

This is useful for example in cluster mode with phased restarts
where you might want the master process to just specify the puma
version and nothing else.

Later in `on_worker_boot` you would manually modify the process
title to suit your needs if you need more specific tags.
This commit is contained in:
Alejandro Martinez Ruiz 2015-10-01 17:41:28 +02:00
parent 1cd87a600f
commit 8c2b5d511d
3 changed files with 5 additions and 2 deletions

View file

@ -144,6 +144,9 @@
# Additional text to display in process listing
#
# tag 'app name'
#
# If you do not specify a tag, Puma will infer it. If you do not want Puma
# to add a tag, use an empty string.
# Change the default timeout of workers
#

View file

@ -266,7 +266,7 @@ module Puma
private
def title
buffer = "puma #{Puma::Const::VERSION} (#{@options[:binds].join(',')})"
buffer << " [#{@options[:tag]}]" if @options[:tag]
buffer << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty?
buffer
end

View file

@ -186,7 +186,7 @@ module Puma
def worker(index, master)
title = "puma: cluster worker #{index}: #{master}"
title << " [#{@options[:tag]}]" if @options[:tag]
title << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty?
$0 = title
Signal.trap "SIGINT", "IGNORE"