Navigation Menu

Skip to content

Commit

Permalink
droonga-engine: handle SIGINT and SIGTERM
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 17, 2014
1 parent b0f8ea2 commit 2ed0521
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/droonga-engine
Expand Up @@ -87,10 +87,14 @@ receiver = Droonga::FluentMessageReceiver.new(loop,
&on_message)
receiver.start

begin
raw_loop.run
rescue Interrupt
trap(:INT) do
raw_loop.stop
end
trap(:TERM) do
raw_loop.stop
end

raw_loop.run

receiver.shutdown
engine.shutdown

0 comments on commit 2ed0521

Please sign in to comment.