lib/good_job/cli.rb in good_job-3.16.4 vs lib/good_job/cli.rb in good_job-3.17.0

- old
+ new

@@ -92,14 +92,16 @@ def start set_up_application! GoodJob.configuration.options.merge!(options.symbolize_keys) configuration = GoodJob.configuration capsule = GoodJob.capsule + systemd = GoodJob::SystemdService.new Daemon.new(pidfile: configuration.pidfile).daemonize if configuration.daemonize? capsule.start + systemd.start if configuration.probe_port probe_server = GoodJob::ProbeServer.new(port: configuration.probe_port) probe_server.start end @@ -112,11 +114,13 @@ Kernel.loop do sleep 0.1 break if @stop_good_job_executable || capsule.shutdown? end - capsule.shutdown(timeout: configuration.shutdown_timeout) - probe_server&.stop + systemd.stop do + capsule.shutdown(timeout: configuration.shutdown_timeout) + probe_server&.stop + end end default_task :start # @!macro thor.desc