Skip to content

Commit

Permalink
Have run_single_worker.rb setup signal traps
Browse files Browse the repository at this point in the history
Instead of the run_single_worker.rb script calling `.start_worker` on
the Runner class, have it instantiate a new class, call
`#setup_sigterm_trap` on that instance, and then call start (effectively
`start_worker`, just adds the `#setup_sigterm_trap` call in the middle)
  • Loading branch information
NickLaMuro committed Aug 16, 2017
1 parent 514af2a commit 7776e35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/workers/bin/run_single_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
end

begin
worker.class::Runner.start_worker(runner_options.merge(:guid => worker.guid))
runner_options[:guid] = worker.guid
worker.class::Runner.new(runner_options).tap(&:setup_sigterm_trap).start
ensure
worker.delete
end
Expand Down

0 comments on commit 7776e35

Please sign in to comment.