Skip to content

Business intelligence made simple

Revert "Changed timeouts to consecutive errors"

Andrew Kane45552ebc5fb5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90e49793..06fe6a75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,6 @@
## 1.4.0 [unreleased]
- Added `slow` cache mode
-- Disable checks after 5 consecutive errors
- Fixed `BLAZER_DATABASE_URL required` error
- Fixed issue with duplicate column names
diff --git a/app/models/blazer/check.rb b/app/models/blazer/check.rb
index d66f345d..07c0f40c 100644
--- a/app/models/blazer/check.rb
+++ b/app/models/blazer/check.rb
@@ -25,12 +25,12 @@ module Blazer
self.last_run_at = Time.now if respond_to?(:last_run_at=)
- if respond_to?(:consecutive_errors=)
- if state == "timed out" || state == "error"
- self.consecutive_errors += 1
- self.state = "disabled" if consecutive_errors >= 5
+ if respond_to?(:timeouts=)
+ if state == "timed out"
+ self.timeouts += 1
+ self.state = "disabled" if timeouts >= 3
else
- self.consecutive_errors = 0
+ self.timeouts = 0
end
end
diff --git a/lib/generators/blazer/templates/install.rb b/lib/generators/blazer/templates/install.rb
index a11d605f..01fadbc0 100644
--- a/lib/generators/blazer/templates/install.rb
+++ b/lib/generators/blazer/templates/install.rb
@@ -38,7 +38,6 @@ class <%= migration_class_name %> < ActiveRecord::Migration
t.text :emails
t.boolean :invert
t.timestamp :last_run_at
- t.integer :consecutive_errors, default: 0
t.timestamps
end
end