Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions aws-flow/lib/aws/decider/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def initialize(service, domain, task_list_to_poll, *args, &block)
Kernel.exit! 1
else
@shutting_down = true
@shutdown_first_time_function.call if @shutdown_first_time_function
end
end
end
Expand Down Expand Up @@ -304,10 +303,6 @@ def initialize(service, domain, task_list, *args, &block)
:logger => @logger
)

@shutdown_first_time_function = lambda do
@executor.shutdown Float::INFINITY
Kernel.exit
end
super(service, domain, task_list, *args)
end

Expand Down Expand Up @@ -438,7 +433,11 @@ def run_once(should_register = true, poller = nil)
@options
) if poller.nil?

Kernel.exit if @shutting_down
if @shutting_down
@executor.shutdown Float::INFINITY
Kernel.exit
end

poller.poll_and_process_single_task(@options.use_forking)
end
end
Expand Down