Skip to content

Commit

Permalink
Add no_wait and rename process on TERM
Browse files Browse the repository at this point in the history
  • Loading branch information
varyform authored and unenemy committed Jan 4, 2022
1 parent f83afc7 commit ec463a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/delayed/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def setup_pools

def run_process(process_name, options = {})
Delayed::Worker.before_fork
Daemons.run_proc(process_name, :dir => options[:pid_dir], :dir_mode => :normal, :no_wait => true, :monitor => @monitor, :ARGV => @args) do |*_args|
Daemons.run_proc(process_name, :log_output => true, :dir => options[:pid_dir], :dir_mode => :normal, :no_wait => true, :monitor => @monitor, :ARGV => @args) do |*_args|
$0 = File.join(options[:prefix], process_name) if @options[:prefix]
run process_name, options
end
Expand Down
1 change: 1 addition & 0 deletions lib/delayed/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def name

def start # rubocop:disable CyclomaticComplexity, PerceivedComplexity
trap('TERM') do
$0 += " (dead since #{Time.now.to_i})"
Thread.new { say 'Exiting...' }
stop
raise SignalException, 'TERM' if self.class.raise_signal_exceptions
Expand Down

0 comments on commit ec463a3

Please sign in to comment.