sidekiq-job_alert 0.1.2 → 0.1.3

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: 61d8b95029b32cce87334cac985d3554194962cc
4
- data.tar.gz: 6c6e9c7b2422bec752bbd9115ec70f5d553800dd
3
+ metadata.gz: 39ab609c07bdeaee07f4d2d236ac4bb6e14e0bb8
4
+ data.tar.gz: 4c04f6dca7f273020e31cc40ff4d3032c6edd643
5
5
  SHA512:
6
- metadata.gz: 9bdcd52fd95dd63130aa7e21697bdde21b834bb36664990ba0c8f5e9db881a78f283fdc69ec8b1086929fc1fb513551a4ca9a9b28acc3c218266e994e6be797f
7
- data.tar.gz: '084968499cb9aabad0c9f1e87ea7c804d39b8105eaad0429d31dc76036a543686d9d1b973a2e64c2c3370ee301d546190b9a79f13c5a6abc794c4de840cfd79e'
6
+ metadata.gz: c837038a95a754c63029c25a41246e3f00d14e1cdd30df705865e0a9fff8e2aeab67ab7c0da356cd00190b43b9afa2707a11eabd9324e8a6ad5f446f43291abb
7
+ data.tar.gz: 8fa5e73e1a231908b20eb9649f51056a24c1b59a02d52491d91be63ed1d4a1263c9282dbe17415e6cdf73fccf50a81a02fabb0d37e5833b6cab61eab74030a45
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-job_alert (0.1.2)
4
+ sidekiq-job_alert (0.1.3)
5
5
  sidekiq (~> 4.2.1)
6
6
  slack-notifier (~> 2.3.2)
7
7
  thor
@@ -13,7 +13,7 @@ module Sidekiq
13
13
 
14
14
  def call
15
15
  @message += make_dead_job_message
16
- @message += make_job_message('alert_total_waiting_jobs', 'all')
16
+ @message += make_all_job_message('alert_total_waiting_jobs')
17
17
  keys = @slack_config[:alert_each_waiting_job].keys
18
18
  keys.delete(:message)
19
19
  keys.each do |key|
@@ -33,6 +33,12 @@ module Sidekiq
33
33
  cnt.positive? ? make_message('alert_dead_jobs', cnt) : ''
34
34
  end
35
35
 
36
+ def make_all_job_message(type)
37
+ cnt = Sidekiq::JobAlert::Queue.all_job_cnt
38
+ limit = @slack_config[type.to_sym][:all][:limit].to_i
39
+ cnt > limit ? make_message(type, cnt) : ''
40
+ end
41
+
36
42
  def make_job_message(type, queue_name)
37
43
  cnt = Sidekiq::JobAlert::Queue.queue_job_cnt(queue_name)
38
44
  limit = @slack_config[type.to_sym][queue_name.to_sym][:limit].to_i
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module JobAlert
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-job_alert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - feng.zhang