YUKI Hiroshi
null+****@clear*****
Thu Apr 23 20:52:27 JST 2015
YUKI Hiroshi 2015-04-23 20:52:27 +0900 (Thu, 23 Apr 2015) New Revision: 6431d277c87451fa384b1f86e792f7f8f92efc57 https://github.com/droonga/droonga-engine/commit/6431d277c87451fa384b1f86e792f7f8f92efc57 Message: Dispose client to get table names from destination node Modified files: lib/droonga/data_absorber_client.rb Modified: lib/droonga/data_absorber_client.rb (+7 -8) =================================================================== --- lib/droonga/data_absorber_client.rb 2015-04-23 19:48:08 +0900 (b869c97) +++ lib/droonga/data_absorber_client.rb 2015-04-23 20:52:27 +0900 (1c17569) @@ -158,19 +158,18 @@ module Droonga }.merge(@client_options) end - def create_destination_client(options={}) - Droonga::Client.new(destination_client_options.merge(options)) - end - def table_names_in_destination_node @table_names_in_destination_node ||= get_table_names_in_destination_node end def get_table_names_in_destination_node - client = create_destination_client(:backend => :thread, - :loop => nil) - response = client.request("dataset" => @source_dataset, - "type" => "table_list") + response = nil + client_options = destination_client_options.merge(:backend => :thread, + :loop => nil) + Droonga::Client.open(client_options) do |client| + response = client.request("dataset" => @source_dataset, + "type" => "table_list") + end unless response raise EmptyResponse.new("table_list returns nil response") -------------- next part -------------- HTML����������������������������...下載