YUKI Hiroshi
null+****@clear*****
Tue Apr 14 21:50:06 JST 2015
YUKI Hiroshi 2015-04-14 21:50:06 +0900 (Tue, 14 Apr 2015) New Revision: 5d6918118c55a9eb060ab8cbea1c1cb5aa04b7c2 https://github.com/droonga/droonga-engine/commit/5d6918118c55a9eb060ab8cbea1c1cb5aa04b7c2 Message: Dispose client for the soruce node Modified files: lib/droonga/plugins/system/absorb_data.rb Modified: lib/droonga/plugins/system/absorb_data.rb (+14 -10) =================================================================== --- lib/droonga/plugins/system/absorb_data.rb 2015-04-14 21:41:20 +0900 (44fc8fd) +++ lib/droonga/plugins/system/absorb_data.rb 2015-04-14 21:50:06 +0900 (5057b31) @@ -233,13 +233,15 @@ module Droonga } end - def source_client - @source_client ||= Droonga::Client.new(source_client_options) + def create_source_client + Droonga::Client.new(source_client_options) end def get_source_tables(&block) - source_client.request("dataset" => source_dataset, - "type" => "table_list") do |response| + client = create_source_client + client.request("dataset" => source_dataset, + "type" => "table_list") do |response| + client.close unless response raise EmptyResponse.new("table_list returns nil response") end @@ -268,12 +270,14 @@ module Droonga }, } end - source_client.request("dataset" => source_dataset, - "type" => "search", - "body" => { - "timeout" => 10, - "queries" => queries, - }) do |response| + client = create_source_client + client.request("dataset" => source_dataset, + "type" => "search", + "body" => { + "timeout" => 10, + "queries" => queries, + }) do |response| + client.close unless response raise EmptyResponse.new("search returns nil response") end -------------- next part -------------- HTML����������������������������... Descargar