瀏覽代碼

Updated generator

Andrew Kane 9 年之前
父節點
當前提交
dcc1b0235b
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 1 1
      lib/blazer/data_source.rb
  2. 6 3
      lib/generators/blazer/templates/config.yml

+ 1 - 1
lib/blazer/data_source.rb

@@ -49,7 +49,7 @@ module Blazer
       @cache ||= begin
         if settings["cache"].is_a?(Hash)
           settings["cache"]
-        else
+        elsif settings["cache"]
           {
             "mode" => "all",
             "expires_in" => settings["cache"]

+ 6 - 3
lib/generators/blazer/templates/config.yml

@@ -8,10 +8,13 @@ data_sources:
     # none by default
     # timeout: 15
 
-    # time to cache results, in minutes
+    # caching settings
     # can greatly improve speed
-    # none by default
-    # cache: 60
+    # off by default
+    # cache:
+    #   mode: slow # or all
+    #   expires_in: 60 # min
+    #   slow_threshold: 15 # sec
 
     # wrap queries in a transaction for safety
     # not necessary if you use a read-only user