[Groonga-commit] droonga/droonga-engine at 1f68993 [master] Accept an environment variable DROONGA_BASE_DIR to specify a path to the configuration directory

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu May 8 19:43:38 JST 2014


YUKI Hiroshi	2014-05-08 19:43:38 +0900 (Thu, 08 May 2014)

  New Revision: 1f689932ce082d6c1e350f7b130bf93b8ce63da4
  https://github.com/droonga/droonga-engine/commit/1f689932ce082d6c1e350f7b130bf93b8ce63da4

  Message:
    Accept an environment variable DROONGA_BASE_DIR to specify a path to the configuration directory

  Modified files:
    lib/droonga/catalog_observer.rb

  Modified: lib/droonga/catalog_observer.rb (+11 -1)
===================================================================
--- lib/droonga/catalog_observer.rb    2014-05-08 19:38:17 +0900 (a768f02)
+++ lib/droonga/catalog_observer.rb    2014-05-08 19:43:38 +0900 (6a82b42)
@@ -23,6 +23,7 @@ module Droonga
     include Loggable
 
     DEFAULT_CATALOG_PATH = "catalog.json"
+    DEFAULT_LIVE_NODES_LIST_PATH = "live-nodes.json"
     CHECK_INTERVAL = 1
 
     attr_reader :catalog
@@ -58,9 +59,13 @@ module Droonga
       end
     end
 
+    def base_path
+      ENV["DROONGA_BASE_DIR"]
+    end
+
     def catalog_path
       path = ENV["DROONGA_CATALOG"] || DEFAULT_CATALOG_PATH
-      File.expand_path(path)
+      File.expand_path(path, base_path)
     end
 
     def catalog_updated?
@@ -75,6 +80,11 @@ module Droonga
       @catalog_mtime = File.mtime(@catalog_path)
     end
 
+    def live_nodes_list_path
+      path = ENV["DROONGA_LIVE_NODES_LIST"] || DEFAULT_LIVE_NODES_LIST_PATH
+      File.expand_path(path, base_path)
+    end
+
     private
     def log_tag
       "catalog-observer"
-------------- next part --------------
HTML����������������������������...
Descargar 



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