Business intelligence made simple
Do not read from cache for checks
Andrew83ab05f865cd
diff --git a/lib/blazer.rb b/lib/blazer.rbindex 9e8adc48..61ba3319 100644--- a/lib/blazer.rb+++ b/lib/blazer.rb@@ -45,7 +45,7 @@ module Blazertries = 0# try 3 times on timeout errorsbegin- 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 += 1end while error && error.include?("canceling statement due to statement timeout") && tries < 3check.update_state(rows, error)diff --git a/lib/blazer/data_source.rb b/lib/blazer/data_source.rbindex 232112a9..0764f498 100644--- a/lib/blazer/data_source.rb+++ b/lib/blazer/data_source.rb@@ -48,7 +48,7 @@ module Blazerrows = nilerror = nilcached_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