sentry-sidekiq 4.8.1 → 5.1.0

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
  SHA256:
3
- metadata.gz: 949887e093455257abbf40b7ff7d8adbb3b28a149bc99a9668be4998089fca0c
4
- data.tar.gz: c98f7768b82b010bfe34dc78b2920503e2599c1183efea781773d2be44dfa9af
3
+ metadata.gz: 50408c0630fd4cb16e51723cf2c728966f96850e5fb3add1fe8b787c15a52489
4
+ data.tar.gz: d21bac14264574baa5798542fb5a461278378cf1109dc19fa3ed8696c7c988e2
5
5
  SHA512:
6
- metadata.gz: fcfcf7c10ff0ca683834944b711bcf4a57492209b32aca63505db44be6fabcd9ed3e9c1671b8fc3c993a385671c5d88d732b7498140b022d45b9e0466e487780
7
- data.tar.gz: 3c6594dba69cfb982254f40442ff6817a57e35c5359e7c330c6717a7855995d463b82f11ab191346575f6054e6b65fce69f12d2a1bcbb5ae3962f448aa939c09
6
+ metadata.gz: 974593b68dca2bd4cc3eaf0c36ed8d66610ad7c2562bf0b645d8aa0e161b61e162423d5dc33b6b9232e0fd7d3b980c1bf7cdeb6763b7184f91fa6ddcf58f867f
7
+ data.tar.gz: 16c7113534b1f35e5649f79ec8b7db4a5a4a070ead2a42664a37b6a0dded8d04215a160b4f80431788804519e8de5ebeac9148de1d1958813ae58f6af51edc2a
data/Gemfile CHANGED
@@ -12,7 +12,7 @@ gem "rexml"
12
12
  sidekiq_version = ENV["SIDEKIQ_VERSION"]
13
13
  sidekiq_version = "6.0" if sidekiq_version.nil?
14
14
 
15
- gem "rails"
15
+ gem "rails", "< 7.0"
16
16
  gem "sidekiq", "~> #{sidekiq_version}"
17
17
 
18
18
  gem "sentry-ruby", path: "../sentry-ruby"
@@ -11,11 +11,9 @@ module Sentry
11
11
  scope = Sentry.get_current_scope
12
12
  scope.set_transaction_name(context_filter.transaction_name) unless scope.transaction_name
13
13
 
14
- retry_option = context.dig(:job, "retry")
15
-
16
- if Sentry.configuration.sidekiq.report_after_job_retries && retry_option.is_a?(Integer) && retry_option.positive?
14
+ if Sentry.configuration.sidekiq.report_after_job_retries && retryable?(context)
17
15
  retry_count = context.dig(:job, "retry_count")
18
- if retry_count.nil? || retry_count < retry_option - 1
16
+ if retry_count.nil? || retry_count < retry_limit(context) - 1
19
17
  return
20
18
  end
21
19
  end
@@ -26,6 +24,27 @@ module Sentry
26
24
  hint: { background: false }
27
25
  )
28
26
  end
27
+
28
+ private
29
+
30
+ def retryable?(context)
31
+ retry_option = context.dig(:job, "retry")
32
+ # when `retry` is not specified, it's default is `true` and it means 25 retries.
33
+ retry_option == true || (retry_option.is_a?(Integer) && retry_option.positive?)
34
+ end
35
+
36
+ def retry_limit(context)
37
+ limit = context.dig(:job, "retry")
38
+
39
+ case limit
40
+ when Integer
41
+ limit
42
+ when TrueClass
43
+ ::Sidekiq.options[:max_retries] || 25
44
+ else
45
+ 0
46
+ end
47
+ end
29
48
  end
30
49
  end
31
50
  end
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Sidekiq
3
- VERSION = "4.8.1"
3
+ VERSION = "5.1.0"
4
4
  end
5
5
  end
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_dependency "sentry-ruby-core", "~> 4.8.1"
25
+ spec.add_dependency "sentry-ruby-core", "~> 5.1.0"
26
26
  spec.add_dependency "sidekiq", ">= 3.0"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sentry-ruby-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.8.1
19
+ version: 5.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.8.1
26
+ version: 5.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement