[Groonga-commit] droonga/droonga-engine at 3696bbd [master] Cache calculated cluster id

Back to archive index

YUKI Hiroshi null+****@clear*****
Sun Nov 30 04:19:26 JST 2014


YUKI Hiroshi	2014-11-30 04:19:26 +0900 (Sun, 30 Nov 2014)

  New Revision: 3696bbd17708d55dc105e73878285d29e7e00c1b
  https://github.com/droonga/droonga-engine/commit/3696bbd17708d55dc105e73878285d29e7e00c1b

  Message:
    Cache calculated cluster id

  Modified files:
    lib/droonga/catalog/base.rb

  Modified: lib/droonga/catalog/base.rb (+5 -1)
===================================================================
--- lib/droonga/catalog/base.rb    2014-11-30 04:17:48 +0900 (ebb7d18)
+++ lib/droonga/catalog/base.rb    2014-11-30 04:19:26 +0900 (8c05b60)
@@ -39,11 +39,15 @@ module Droonga
       end
 
       def cluster_id
+        @cluster_id ||= calculate_cluster_id
+      end
+
+      private
+      def calculate_cluster_id
         raw_id = all_nodes.sort.join(",")
         Digest::SHA1.hexdigest(raw_id)
       end
 
-      private
       def migrate_database_location(current_db_path, device, name)
         return if current_db_path.exist?
 
-------------- next part --------------
HTML����������������������������...
下載 



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