[Groonga-commit] long-long-float/droonga-engine at 124f0a2 [master] Fix missing variable error for catalog

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Aug 29 11:51:08 JST 2014


YUKI Hiroshi	2014-08-29 11:51:08 +0900 (Fri, 29 Aug 2014)

  New Revision: 124f0a20e0085e0fe16ef5ea30a24b4991209c1d
  https://github.com/long-long-float/droonga-engine/commit/124f0a20e0085e0fe16ef5ea30a24b4991209c1d

  Message:
    Fix missing variable error for catalog

  Modified files:
    lib/droonga/command/remote.rb

  Modified: lib/droonga/command/remote.rb (+5 -5)
===================================================================
--- lib/droonga/command/remote.rb    2014-08-29 11:46:39 +0900 (adbe860)
+++ lib/droonga/command/remote.rb    2014-08-29 11:51:08 +0900 (c0be8fc)
@@ -159,12 +159,14 @@ module Droonga
 
           log("source_node = #{source_node}")
 
+          @catalog = fetch_catalog
+
           other_hosts = replica_hosts
           log("other_hosts = #{other_hosts}")
           return if other_hosts.empty?
 
           # restart self with the fetched catalog.
-          SafeFileWriter.write(Path.catalog, JSON.pretty_generate(catalog))
+          SafeFileWriter.write(Path.catalog, JSON.pretty_generate(@catalog))
 
           absorb_data if should_absorb_data?
 
@@ -178,11 +180,9 @@ module Droonga
           @serf.join(*other_hosts)
         end
 
-        def replica_hosts(catalog=nil)
-          catalog ||= fetch_catalog
-
+        def replica_hosts
           generator = CatalogGenerator.new
-          generator.load(catalog)
+          generator.load(@catalog)
           dataset = generator.dataset_for_host(source_host) ||
                       generator.dataset_for_host(host)
           return [] unless dataset
-------------- next part --------------
HTML����������������������������...
Download 



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