New option to set application name (#606)

This commit is contained in:
Aravinda Vishwanathapura 2021-04-05 20:35:06 +05:30 committed by GitHub
parent 3fee068636
commit de5e022222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View file

@ -67,11 +67,11 @@ module Kemal
def self.display_startup_message(config, server)
addresses = server.addresses.join ", " { |address| "#{config.scheme}://#{address}" }
log "[#{config.env}] Kemal is ready to lead at #{addresses}"
log "[#{config.env}] #{config.app_name} is ready to lead at #{addresses}"
end
def self.stop
raise "Kemal is already stopped." if !config.running
raise "#{Kemal.config.app_name} is already stopped." if !config.running
if server = config.server
server.close unless server.closed?
config.running = false
@ -90,7 +90,7 @@ module Kemal
private def self.setup_trap_signal
Signal::INT.trap do
log "Kemal is going to take a rest!" if Kemal.config.shutdown_message
log "#{Kemal.config.app_name} is going to take a rest!" if Kemal.config.shutdown_message
Kemal.stop
exit
end