Skip to content

Business intelligence made simple

Reload check state before updating

Andrew Kane46b968560ffa
diff --git a/lib/blazer.rb b/lib/blazer.rb
index 47877ae0..0879f31c 100644
--- a/lib/blazer.rb
+++ b/lib/blazer.rb
@@ -129,6 +129,7 @@ module Blazer
break
end
end
+ check.reload # in case state has changed since job started
check.update_state(result)
# TODO use proper logfmt
Rails.logger.info "[blazer check] query=#{check.query.name} state=#{check.state} rows=#{result.rows.try(:size)} error=#{result.error}"