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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25e7a645fef4b5bfc9dd087e14785e939af10b17
4
- data.tar.gz: ec028e2cde1ef2eb36345451b4366f79f96afe0c
3
+ metadata.gz: 3a7e47a5026491abde5ec05f98a1eb4d6546296e
4
+ data.tar.gz: 9c985fc8163eacc76b3affed9ee3c227b63926ca
5
5
  SHA512:
6
- metadata.gz: a4820e308d2e810f52da0c6d91fa0a3289f016771f0414e0f2ca4a2552f1069bb5d3867568b615fb9c98def6d8190c940947e125e773931b9de124301f73dd7f
7
- data.tar.gz: cf7aba28bfcf07849865492033aafc785972d67f0bbdc5dae7a47f2aac36ab0e8ffff75587b08eff9290003c392cf285a81fd20d6d719d9dc4c92961a79b3b4d
6
+ metadata.gz: 867766b64a1183768e58c48a32eb24e9868969ffbf5b93ce392c305be877df93c965f28251242c1cf9f420595b3b1876cf7ae04525a5669e9dd449822544f589
7
+ data.tar.gz: 84d4d0e2074dd029b44fb2992863b22b894c8129b7deefae15e3ebff5925b519a6a9ac54813f853aee6e9dec4313c05086431ced428fcccb3aa2c617b65e35e6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -64,10 +64,21 @@ module SidekiqUtils
64
64
  end
65
65
 
66
66
  def slack_alert(alert_message)
67
- Array.wrap(config['channels_to_alert']).each do |slack_name|
68
- Slack.send_message(
69
- slack_name, alert_message,
70
- icon: ':alarm_clock:', username: 'Sidekiq alerts')
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
 
@@ -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.1 ruby lib
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.1"
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus von Koeller