sidekiq_utils 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/sidekiq_utils/latency_alert.rb +15 -4
- data/sidekiq_utils.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a7e47a5026491abde5ec05f98a1eb4d6546296e
|
4
|
+
data.tar.gz: 9c985fc8163eacc76b3affed9ee3c227b63926ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867766b64a1183768e58c48a32eb24e9868969ffbf5b93ce392c305be877df93c965f28251242c1cf9f420595b3b1876cf7ae04525a5669e9dd449822544f589
|
7
|
+
data.tar.gz: 84d4d0e2074dd029b44fb2992863b22b894c8129b7deefae15e3ebff5925b519a6a9ac54813f853aee6e9dec4313c05086431ced428fcccb3aa2c617b65e35e6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -64,10 +64,21 @@ module SidekiqUtils
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def slack_alert(alert_message)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
return unless config['slack'].present?
|
68
|
+
require 'slack-notifier'
|
69
|
+
@slack ||= Slack::Notifier.new(
|
70
|
+
"https://#{config['slack']['team']}.slack.com/services/hooks/incoming-webhook?"\
|
71
|
+
"token=#{config['slack']['token']}",
|
72
|
+
username: config['slack']['username'] || 'Sidekiq alerts',
|
73
|
+
icon_emoji: ":#{config['slack']['icon'] || 'alarm_clock'}:")
|
74
|
+
|
75
|
+
if defined?(Rails) && !Rails.env.production?
|
76
|
+
channels = ['#test-channel']
|
77
|
+
else
|
78
|
+
channels = config['slack']['channels_to_alert']
|
79
|
+
end
|
80
|
+
Array.wrap(channels).each do |slack_name|
|
81
|
+
@slack.ping(alert_message, channel: slack_name)
|
71
82
|
end
|
72
83
|
end
|
73
84
|
|
data/sidekiq_utils.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sidekiq_utils 1.0.
|
5
|
+
# stub: sidekiq_utils 1.0.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "sidekiq_utils".freeze
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|