Kouhei Sutou
null+****@clear*****
Sat Sep 6 00:09:40 JST 2014
Kouhei Sutou 2014-09-06 00:09:40 +0900 (Sat, 06 Sep 2014) New Revision: 462b70a4ca67b827bc20937f83869ff37f94cd9c https://github.com/droonga/droonga-engine/commit/462b70a4ca67b827bc20937f83869ff37f94cd9c Message: slice: support graceful stop Modified files: lib/droonga/slice.rb Modified: lib/droonga/slice.rb (+17 -0) =================================================================== --- lib/droonga/slice.rb 2014-09-06 00:08:57 +0900 (e53c6a4) +++ lib/droonga/slice.rb 2014-09-06 00:09:40 +0900 (2c1b052) @@ -44,6 +44,23 @@ module Droonga start_supervisor end + def stop_gracefully + logger.trace("stop_gracefully: start") + on_finish = lambda do + @job_pusher.shutdown + @processor.shutdown + yield if block_given? + end + if @supervisor + @supervisor.stop_gracefully do + on_finish.call + end + else + on_finish.call + end + logger.trace("stop_gracefully: done") + end + def shutdown logger.trace("shutdown: start") shutdown_supervisor if @supervisor -------------- next part -------------- HTML����������������������������... Descargar