YUKI Hiroshi
null+****@clear*****
Thu May 8 17:19:52 JST 2014
YUKI Hiroshi 2014-05-08 17:19:52 +0900 (Thu, 08 May 2014) New Revision: f9114cc6fd70ae7fe55083981d927961583cef75 https://github.com/droonga/droonga-engine/commit/f9114cc6fd70ae7fe55083981d927961583cef75 Message: Discard old live nodes list Modified files: lib/droonga/serf_event_handler.rb Modified: lib/droonga/serf_event_handler.rb (+10 -0) =================================================================== --- lib/droonga/serf_event_handler.rb 2014-05-08 17:03:22 +0900 (698d49a) +++ lib/droonga/serf_event_handler.rb 2014-05-08 17:19:52 +0900 (ea9ab63) @@ -57,7 +57,15 @@ module Droonga @payload = $stdin end + def self_changed? + changed_nodes.keys.include?(ENV["SERF_SELF_NAME"]) + end + def changed_nodes + @changed_nodes ||= parse_changed_nodes + end + + def parse_changed_nodes nodes = {} @payload.each_line do |node| name, address, role, tags = node.strip.split(/\s+/) @@ -71,6 +79,8 @@ module Droonga end def last_live_nodes + return {} if self_changed? + return {} unless @live_nodes_file return {} unless @live_nodes_file.exist? -------------- next part -------------- HTML����������������������������...下載