[Groonga-commit] droonga/droonga-engine at 2ed0521 [master] droonga-engine: handle SIGINT and SIGTERM

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Apr 17 18:24:21 JST 2014


Kouhei Sutou	2014-04-17 18:24:21 +0900 (Thu, 17 Apr 2014)

  New Revision: 2ed0521d56c116b583f89447a8b216f2e3d4eee8
  https://github.com/droonga/droonga-engine/commit/2ed0521d56c116b583f89447a8b216f2e3d4eee8

  Message:
    droonga-engine: handle SIGINT and SIGTERM

  Modified files:
    bin/droonga-engine

  Modified: bin/droonga-engine (+7 -3)
===================================================================
--- bin/droonga-engine    2014-04-17 17:01:11 +0900 (e232339)
+++ bin/droonga-engine    2014-04-17 18:24:21 +0900 (f589c98)
@@ -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
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index