[Groonga-commit] droonga/drndump at 0178fb5 [master] Support dump.start

Back to archive index

Kouhei Sutou null+****@clear*****
Tue May 13 19:00:36 JST 2014


Kouhei Sutou	2014-05-13 19:00:36 +0900 (Tue, 13 May 2014)

  New Revision: 0178fb5c97686c9db82e481a5667dc2a38ba54fc
  https://github.com/droonga/drndump/commit/0178fb5c97686c9db82e481a5667dc2a38ba54fc

  Message:
    Support dump.start

  Modified files:
    bin/drndump

  Modified: bin/drndump (+5 -1)
===================================================================
--- bin/drndump    2014-05-13 18:46:39 +0900 (182f39e)
+++ bin/drndump    2014-05-13 19:00:36 +0900 (66d7693)
@@ -86,6 +86,7 @@ dump_message = {
 client = Droonga::Client.new(options)
 
 error_message = nil
+n_dumpers = 0
 client.subscribe(dump_message) do |message|
   case message
   when Droonga::Client::Error
@@ -104,8 +105,11 @@ client.subscribe(dump_message) do |message|
       add_message.delete("inReplyTo")
       add_message["type"] = "add"
       puts(JSON.pretty_generate(add_message))
+    when "dump.start"
+      n_dumpers += 1
     when "dump.end"
-      client.close
+      n_dumpers -= 1
+      client.close if n_dumpers <= 0
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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