Class: SolidStackWeb::AlertWebhook
- Inherits:
-
Object
- Object
- SolidStackWeb::AlertWebhook
- Defined in:
- app/models/solid_stack_web/alert_webhook.rb
Constant Summary collapse
- COOLDOWN_CACHE_KEY =
"solid_stack_web/alert_webhook/cooldown"
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(queue_stats) ⇒ AlertWebhook
constructor
A new instance of AlertWebhook.
Constructor Details
#initialize(queue_stats) ⇒ AlertWebhook
Returns a new instance of AlertWebhook.
12 13 14 |
# File 'app/models/solid_stack_web/alert_webhook.rb', line 12 def initialize(queue_stats) @queue_stats = queue_stats end |
Class Method Details
.check(queue_stats) ⇒ Object
8 9 10 |
# File 'app/models/solid_stack_web/alert_webhook.rb', line 8 def self.check(queue_stats) new(queue_stats).check end |
Instance Method Details
#check ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/solid_stack_web/alert_webhook.rb', line 16 def check return unless SolidStackWeb.alert_webhook_url return if on_cooldown? alerts = build_alerts return if alerts.empty? deliver(alerts) set_cooldown end |