Просмотр исходного кода

Do not read from cache for checks

Andrew 9 лет назад
Родитель
Сommit
83ab05f865
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      lib/blazer.rb
  2. 1 1
      lib/blazer/data_source.rb

+ 1 - 1
lib/blazer.rb

@@ -45,7 +45,7 @@ module Blazer
       tries = 0
       # try 3 times on timeout errors
       begin
-        rows, error, cached_at = data_sources[check.query.data_source].run_statement(check.query.statement)
+        rows, error, cached_at = data_sources[check.query.data_source].run_statement(check.query.statement, refresh_cache: true)
         tries += 1
       end while error && error.include?("canceling statement due to statement timeout") && tries < 3
       check.update_state(rows, error)

+ 1 - 1
lib/blazer/data_source.rb

@@ -48,7 +48,7 @@ module Blazer
       rows = nil
       error = nil
       cached_at = nil
-      if cache
+      if cache && !options[:refresh_cache]
         cache_key = self.cache_key(statement)
         value = Blazer.cache.read(cache_key)
         rows, cached_at = Marshal.load(value) if value