Browse Source

Reload check state before updating

Andrew Kane 6 years ago
parent
commit
46b968560f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/blazer.rb

+ 1 - 0
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}"