airbrake 13.0.3 → 13.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake/rails/event.rb +9 -2
- data/lib/airbrake/sidekiq/retryable_jobs_filter.rb +14 -8
- data/lib/airbrake/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36be71feb2a3c598d076b4b2ba57a68b8d27b477c62411db53af82c521a10e1f
|
4
|
+
data.tar.gz: 50dbe6f23edc841ef8d027bab37efe3c2fd423925ca56c6113edbb2d13d60022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 716a0ab382e63107913652c09a4f095ee7506d196cfaeb709fa5cf99feecfe5888c3fce2453e543f92c8bd9c35cf9bd570d97b1cff8cebdb888747d8e58c6dae
|
7
|
+
data.tar.gz: cf8e839c634fa6530cb0f0eb1a1b1e6115d1fff13e87378c4d9c4d395675ba6c3c924e7b0f0c0a2c60c53d9321d06a94d27314bcdb5902988afbae32395230ff
|
data/lib/airbrake/rails/event.rb
CHANGED
@@ -17,7 +17,6 @@ module Airbrake
|
|
17
17
|
|
18
18
|
def initialize(*args)
|
19
19
|
@event = ActiveSupport::Notifications::Event.new(*args)
|
20
|
-
@rails_7_or_greater = ::Rails::VERSION::MAJOR >= 7
|
21
20
|
end
|
22
21
|
|
23
22
|
def method
|
@@ -54,7 +53,11 @@ module Airbrake
|
|
54
53
|
#
|
55
54
|
# Relevant commit:
|
56
55
|
# https://github.com/rails/rails/commit/81d0dc90becfe0b8e7f7f26beb66c25d84b8ec7f
|
57
|
-
|
56
|
+
#
|
57
|
+
# Ensure this conversion is applied exclusively for Rails 7.0
|
58
|
+
return @event.time / MILLISECOND if rails_7_0?
|
59
|
+
|
60
|
+
@event.time
|
58
61
|
end
|
59
62
|
|
60
63
|
def groups
|
@@ -88,6 +91,10 @@ module Airbrake
|
|
88
91
|
def duration
|
89
92
|
@event.duration
|
90
93
|
end
|
94
|
+
|
95
|
+
def rails_7_0?
|
96
|
+
::Rails::VERSION::MAJOR == 7 && ::Rails::VERSION::MINOR == 0
|
97
|
+
end
|
91
98
|
end
|
92
99
|
end
|
93
100
|
end
|
@@ -6,17 +6,20 @@ module Airbrake
|
|
6
6
|
# by Sidekiq
|
7
7
|
# @since v7.3.0
|
8
8
|
class RetryableJobsFilter
|
9
|
-
|
9
|
+
SIDEKIQ_GTE_5_0_0 = Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new('5.0.0')
|
10
|
+
SIDEKIQ_GTE_7_0_0 = Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new('7.0.0')
|
11
|
+
|
12
|
+
if SIDEKIQ_GTE_5_0_0
|
13
|
+
require 'sidekiq/job_retry'
|
14
|
+
DEFAULT_MAX_RETRY_ATTEMPTS = ::Sidekiq::JobRetry::DEFAULT_MAX_RETRY_ATTEMPTS
|
15
|
+
else
|
10
16
|
require 'sidekiq/middleware/server/retry_jobs'
|
11
17
|
DEFAULT_MAX_RETRY_ATTEMPTS = \
|
12
18
|
::Sidekiq::Middleware::Server::RetryJobs::DEFAULT_MAX_RETRY_ATTEMPTS
|
13
|
-
else
|
14
|
-
require 'sidekiq/job_retry'
|
15
|
-
DEFAULT_MAX_RETRY_ATTEMPTS = ::Sidekiq::JobRetry::DEFAULT_MAX_RETRY_ATTEMPTS
|
16
19
|
end
|
17
20
|
|
18
21
|
def initialize(max_retries: nil)
|
19
|
-
@
|
22
|
+
@retries_before_notify = max_retries
|
20
23
|
end
|
21
24
|
|
22
25
|
def call(notice)
|
@@ -36,8 +39,8 @@ module Airbrake
|
|
36
39
|
end
|
37
40
|
|
38
41
|
def max_attempts_for(job)
|
39
|
-
if @
|
40
|
-
@
|
42
|
+
if @retries_before_notify
|
43
|
+
@retries_before_notify
|
41
44
|
elsif job['retry'].is_a?(Integer)
|
42
45
|
job['retry']
|
43
46
|
else
|
@@ -46,7 +49,10 @@ module Airbrake
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def max_retries
|
49
|
-
@max_retries ||=
|
52
|
+
@max_retries ||= begin
|
53
|
+
config = SIDEKIQ_GTE_7_0_0 ? ::Sidekiq.default_configuration : ::Sidekiq.options
|
54
|
+
config[:max_retries] || DEFAULT_MAX_RETRY_ATTEMPTS
|
55
|
+
end
|
50
56
|
end
|
51
57
|
end
|
52
58
|
end
|
data/lib/airbrake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.0.
|
4
|
+
version: 13.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|
@@ -349,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
349
|
- !ruby/object:Gem::Version
|
350
350
|
version: '0'
|
351
351
|
requirements: []
|
352
|
-
rubygems_version: 3.3.
|
352
|
+
rubygems_version: 3.3.20
|
353
353
|
signing_key:
|
354
354
|
specification_version: 4
|
355
355
|
summary: Airbrake is an online tool that provides robust exception tracking in any
|