YUKI Hiroshi
null+****@clear*****
Fri Apr 10 15:33:10 JST 2015
YUKI Hiroshi 2015-04-10 15:33:10 +0900 (Fri, 10 Apr 2015) New Revision: b305c0826194f5199cf422287d7b52bd8bea4184 https://github.com/droonga/droonga-engine/commit/b305c0826194f5199cf422287d7b52bd8bea4184 Message: Fill missing "date" parameter of forwarding message Modified files: lib/droonga/plugins/system/absorb_data.rb Modified: lib/droonga/plugins/system/absorb_data.rb (+9 -0) =================================================================== --- lib/droonga/plugins/system/absorb_data.rb 2015-04-10 13:49:28 +0900 (01732a3) +++ lib/droonga/plugins/system/absorb_data.rb 2015-04-10 15:33:10 +0900 (d445d59) @@ -13,6 +13,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +require "time" + require "droonga/plugin" require "droonga/catalog/dataset" require "droonga/node_name" @@ -49,6 +51,7 @@ module Droonga serf.set_tag("absorbing", true) error_message = dumper.run do |message| + message["date"] ||= new_date @messenger.forward(message, "to" => my_node_name, "type" => message["type"]) @@ -83,6 +86,12 @@ module Droonga def my_node_name @messenger.engine_state.name end + + MICRO_SECONDS_DECIMAL_PLACE = 6 + + def new_date + Time.now.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE) + end end define_single_step do |step| -------------- next part -------------- HTML����������������������������... Download