[Groonga-commit] droonga/droonga-engine at 3ed253b [master] Dispose client correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Apr 15 17:46:26 JST 2015


YUKI Hiroshi	2015-04-15 17:46:26 +0900 (Wed, 15 Apr 2015)

  New Revision: 3ed253b4092c09ba850efcc2f863f6682a1c3937
  https://github.com/droonga/droonga-engine/commit/3ed253b4092c09ba850efcc2f863f6682a1c3937

  Message:
    Dispose client correctly

  Modified files:
    lib/droonga/data_absorber_client.rb

  Modified: lib/droonga/data_absorber_client.rb (+5 -4)
===================================================================
--- lib/droonga/data_absorber_client.rb    2015-04-15 17:13:09 +0900 (67d984e)
+++ lib/droonga/data_absorber_client.rb    2015-04-15 17:46:26 +0900 (ebca07a)
@@ -87,10 +87,11 @@ module Droonga
           "progressIntervalSeconds" => @progress_interval_seconds,
         },
       }
-      destination_client.subscribe(absorb_message) do |message|
+      client = create_destination_client
+      client.subscribe(absorb_message) do |message|
         case message
         when Droonga::Client::Error
-          destination_client.close
+          client.close
           @error_message = message.to_s
         else
           case message["type"]
@@ -115,7 +116,7 @@ module Droonga
       end
     end
 
-    def destination_client
+    def create_destination_client
       options = {
         :host          => @host,
         :port          => @port,
@@ -124,7 +125,7 @@ module Droonga
         :receiver_host => @receiver_host,
         :receiver_port => @receiver_port,
       }.merge(@client_options)
-      @destination_client ||= Droonga::Client.new(options)
+      Droonga::Client.new(options)
     end
 
     def source_node_suspendable?
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index