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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sidekiq/job_alert/notifier.rb +7 -1
- data/lib/sidekiq/job_alert/version.rb +1 -1
- 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: 39ab609c07bdeaee07f4d2d236ac4bb6e14e0bb8
|
4
|
+
data.tar.gz: 4c04f6dca7f273020e31cc40ff4d3032c6edd643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c837038a95a754c63029c25a41246e3f00d14e1cdd30df705865e0a9fff8e2aeab67ab7c0da356cd00190b43b9afa2707a11eabd9324e8a6ad5f446f43291abb
|
7
|
+
data.tar.gz: 8fa5e73e1a231908b20eb9649f51056a24c1b59a02d52491d91be63ed1d4a1263c9282dbe17415e6cdf73fccf50a81a02fabb0d37e5833b6cab61eab74030a45
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,7 @@ module Sidekiq
|
|
13
13
|
|
14
14
|
def call
|
15
15
|
@message += make_dead_job_message
|
16
|
-
@message +=
|
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
|