sentry-sidekiq 5.22.1 → 5.22.2

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: 2aa3f4ae82ab8d6fc5fba46337262b12da3a0dd00d5e62ff4489ecf533b93869
4
- data.tar.gz: 0f337deae3dd7d56fcf5309ba511ed42aa5f97ea6754e77cf931dc91eea9f099
3
+ metadata.gz: b36dbbd090d1178b71b8ce282e0bb053b067ea7e05e0d7c215a3d29fa3872817
4
+ data.tar.gz: 2fee63cd4fdfea8e290d089e7143b48a4324153e77fb87c9bfe22226fed27a80
5
5
  SHA512:
6
- metadata.gz: 611488068db6136aa27ec043d01e5787f0e8d7199ffbc3a6628ab1fd6bab8692f50e19dd42718e14c15623422704b53a8ca052bbdf1d194bbec7dfeb6ef5609c
7
- data.tar.gz: 896d0b90b5ef1992d0137ba905e2db8b1c6a5c04ab2f6d3ee9b7f9cb1fc016796bb3dbcf42b550074c83677701c825e4609c019ef8fd91412bb02328ad3f2920
6
+ metadata.gz: dc2966e26f5431bd2b6fd1a47015da73bc8f1e75cca2d19b6722498bb5cdf2c6c270e4c8d308555b6ededca6cf9a8e1e670d111aa457e1fb24719669973dadcb
7
+ data.tar.gz: 6254ece04b3c5215ca119a5f7272d7d0d101b0ccbb3700f91c00b4fd957f14b8a06fd6fd1617d437c81509931b39bfd9bda7576c153a262873dcd0e07544c148
@@ -11,7 +11,10 @@ module Sentry
11
11
  end
12
12
 
13
13
  module Sidekiq
14
- IGNORE_DEFAULT = ["Sidekiq::JobRetry::Skip"]
14
+ IGNORE_DEFAULT = [
15
+ "Sidekiq::JobRetry::Skip",
16
+ "Sidekiq::JobRetry::Handled"
17
+ ]
15
18
 
16
19
  class Configuration
17
20
  # Set this option to true if you want Sentry to only capture the last job
@@ -31,6 +31,19 @@ module Sentry
31
31
  end
32
32
  end
33
33
 
34
+ # Check if the retry count is below the attempt_threshold
35
+ attempt_threshold = context.dig(:job, "attempt_threshold")
36
+ if attempt_threshold && retryable?(context)
37
+ attempt_threshold = attempt_threshold.to_i
38
+ retry_count = context.dig(:job, "retry_count")
39
+ # attempt 1 - retry_count is nil
40
+ # attempt 2 - this is your first retry so retry_count is 0
41
+ # attempt 3 - you have retried once, retry_count is 1
42
+ attempt = retry_count.nil? ? 1 : retry_count.to_i + 2
43
+
44
+ return if attempt < attempt_threshold
45
+ end
46
+
34
47
  Sentry::Sidekiq.capture_exception(
35
48
  ex,
36
49
  contexts: { sidekiq: context_filter.filtered },
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sentry
4
4
  module Sidekiq
5
- VERSION = "5.22.1"
5
+ VERSION = "5.22.2"
6
6
  end
7
7
  end
@@ -38,16 +38,14 @@ module Sentry
38
38
  monitor_config =
39
39
  case interval_type
40
40
  when "cron"
41
- # fugit is a second order dependency of sidekiq-scheduler via rufus-scheduler
42
- parsed_cron = ::Fugit.parse_cron(schedule)
43
- timezone = parsed_cron.timezone
41
+ # Split schedule into cron and timezone parts (if timezone exists)
42
+ cron_parts = schedule.strip.split(" ")
44
43
 
45
- # fugit supports having the timezone part of the cron string,
46
- # so we need to pull that with some hacky stuff
47
- if timezone
48
- parsed_cron.instance_variable_set(:@timezone, nil)
49
- cron_without_timezone = parsed_cron.to_cron_s
50
- Sentry::Cron::MonitorConfig.from_crontab(cron_without_timezone, timezone: timezone.name)
44
+ if cron_parts.length > 5
45
+ timezone = cron_parts.pop
46
+ cron_without_timezone = cron_parts.join(" ")
47
+
48
+ Sentry::Cron::MonitorConfig.from_crontab(cron_without_timezone, timezone: timezone)
51
49
  else
52
50
  Sentry::Cron::MonitorConfig.from_crontab(schedule)
53
51
  end
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "sentry-ruby", "~> 5.22.1"
33
+ spec.add_dependency "sentry-ruby", "~> 5.22.2"
34
34
  spec.add_dependency "sidekiq", ">= 3.0"
35
35
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.22.1
4
+ version: 5.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-16 00:00:00.000000000 Z
10
+ date: 2025-01-24 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: sentry-ruby
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 5.22.1
18
+ version: 5.22.2
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 5.22.1
25
+ version: 5.22.2
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: sidekiq
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -69,16 +68,15 @@ files:
69
68
  - lib/sentry/sidekiq/sentry_context_middleware.rb
70
69
  - lib/sentry/sidekiq/version.rb
71
70
  - sentry-sidekiq.gemspec
72
- homepage: https://github.com/getsentry/sentry-ruby/tree/5.22.1/sentry-sidekiq
71
+ homepage: https://github.com/getsentry/sentry-ruby/tree/5.22.2/sentry-sidekiq
73
72
  licenses:
74
73
  - MIT
75
74
  metadata:
76
- homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.22.1/sentry-sidekiq
77
- source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.22.1/sentry-sidekiq
78
- changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.22.1/CHANGELOG.md
75
+ homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.22.2/sentry-sidekiq
76
+ source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.22.2/sentry-sidekiq
77
+ changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.22.2/CHANGELOG.md
79
78
  bug_tracker_uri: https://github.com/getsentry/sentry-ruby/issues
80
- documentation_uri: http://www.rubydoc.info/gems/sentry-sidekiq/5.22.1
81
- post_install_message:
79
+ documentation_uri: http://www.rubydoc.info/gems/sentry-sidekiq/5.22.2
82
80
  rdoc_options: []
83
81
  require_paths:
84
82
  - lib
@@ -93,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
91
  - !ruby/object:Gem::Version
94
92
  version: '0'
95
93
  requirements: []
96
- rubygems_version: 3.5.22
97
- signing_key:
94
+ rubygems_version: 3.6.2
98
95
  specification_version: 4
99
96
  summary: A gem that provides Sidekiq integration for the Sentry error logger
100
97
  test_files: []