rails-informant 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails_informant/notifiers/notification_policy.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 206cb69356bdf4d40de95e2435428cf0413f85ed56f7cdbed4912431fb2ddd6e
|
|
4
|
+
data.tar.gz: c2c7b3844c83ae2e92d389a9f8d914dfc3b4ff6ea599f741a6e31cdf10866254
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19e1887a018a41d07163385fc1a7868ea21f33ea9599de3c6f8aaae309c2939f93c386fc7a21582e109ff15c8df5f21702f1aed77bd2b92af5beb41bb26f73c6
|
|
7
|
+
data.tar.gz: 5bd2451b4a52590e2687c2009b6603a5e1a2df42451508ad0bc1e24f5cb86377020bbb6b79336c2aa1fe2213061c4235911046b9423aaf575fcd2c2db47ffe31
|
|
@@ -9,6 +9,7 @@ module RailsInformant
|
|
|
9
9
|
module NotificationPolicy
|
|
10
10
|
COOLDOWN = 1.hour
|
|
11
11
|
MILESTONE_COUNTS = [ 10, 100, 1000 ].freeze
|
|
12
|
+
SILENT_STATUSES = %w[duplicate ignored].freeze
|
|
12
13
|
|
|
13
14
|
PRIVATE_NETWORKS = [
|
|
14
15
|
IPAddr.new("0.0.0.0/8"), # "This" network
|
|
@@ -30,6 +31,7 @@ module RailsInformant
|
|
|
30
31
|
].freeze
|
|
31
32
|
|
|
32
33
|
def should_notify?(error_group)
|
|
34
|
+
return false if error_group.status.in?(SILENT_STATUSES)
|
|
33
35
|
return true if error_group.total_occurrences == 1
|
|
34
36
|
return true if error_group.total_occurrences.in?(MILESTONE_COUNTS)
|
|
35
37
|
return true if error_group.last_notified_at.nil?
|