From 0a6f03cde0a336597358668041fa8eb6f463bac5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 6 Apr 2017 05:15:29 +0000 Subject: allow omitting specifying socket name when inheriting listen socket Since the common case is still to run a single app inside yahns, we can simplify setup a bit for systemd (and like) users by allowing them to omit the "listen" directive when they are running a single app in yahns. --- lib/yahns/config.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/yahns/config.rb') diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb index e545d59..bcea0d4 100644 --- a/lib/yahns/config.rb +++ b/lib/yahns/config.rb @@ -438,4 +438,9 @@ class Yahns::Config # :nodoc: @app_ctx.each { |app| app.logger ||= server.logger } end + + def register_inherited(name) + return unless @config_listeners.empty? && @app_ctx.size == 1 + @config_listeners[name] = { :yahns_app_ctx => @app_ctx[0] } + end end -- cgit v1.2.3-24-ge0c7