sidekiq_publisher 2.0.1 → 2.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: 35ad0d16467d78de77ede70a744b248a9dbe33d6f4ceec9c37df10c8478693d1
4
- data.tar.gz: af3f7362bb2f539a1a8d4b506f8004fc9cdf9b9927685fc09fc49f74b569cf54
3
+ metadata.gz: aa63cc2e02febd7a4fe0da8a1deba89df521cf9df46d453626ee80c45cb441c1
4
+ data.tar.gz: 8c4ba92a29040892080f1b0248dfec8a6f1193063f054c48d6736e3fc15a9e40
5
5
  SHA512:
6
- metadata.gz: 549f8fd72294075b7f5cca99edcf2b6a2682210f1a494fcf9ce1639c91bd43f8139a269bc1045108de6c52820e5416277fdd04497a795ed5c123a5a2ae77f33c
7
- data.tar.gz: 62f6cd338b10e13a82ab4421d55817df95f5d791ac83a5f2e2f4dbdae2327c69a0e09d7b914711d7216651294d30788d411d9ab0eb8208d78b941c6dd8da98ce
6
+ metadata.gz: '01874b1f9cad7364bf28af24830f62278c3e6aea796a5af4b66ca1fc5c3a63806f48fe3a44892f40c18759dabe58f825d444f28fb48f7b76777440c988120728'
7
+ data.tar.gz: 9c1c712c199f2abc7fa86c61d9739c1739d78200978071cb0b4ee0cb470091c5d84cf310f0a523f5cb31c98b87ed0ef2afd42ca61d3d743c7f605dde45b32663
data/Appraisals CHANGED
@@ -36,6 +36,12 @@ appraise "rails-5.2-sidekiq-6.2" do
36
36
  gem "sidekiq", "~> 6.2.0"
37
37
  end
38
38
 
39
+ appraise "rails-5.2-sidekiq-6.3" do
40
+ gem "activejob", "~> 5.2.0"
41
+ gem "activesupport", "~> 5.2.0"
42
+ gem "sidekiq", "~> 6.3.0"
43
+ end
44
+
39
45
  appraise "rails-6.0-sidekiq-5.2" do
40
46
  gem "activejob", "~> 6.0.0"
41
47
  gem "activesupport", "~> 6.0.0"
@@ -60,6 +66,12 @@ appraise "rails-6.0-sidekiq-6.2" do
60
66
  gem "sidekiq", "~> 6.2.0"
61
67
  end
62
68
 
69
+ appraise "rails-6.0-sidekiq-6.3" do
70
+ gem "activejob", "~> 6.0.0"
71
+ gem "activesupport", "~> 6.0.0"
72
+ gem "sidekiq", "~> 6.3.0"
73
+ end
74
+
63
75
  appraise "rails-6.1-sidekiq-5.2" do
64
76
  gem "activejob", "~> 6.1.0"
65
77
  gem "activesupport", "~> 6.1.0"
@@ -83,3 +95,9 @@ appraise "rails-6.1-sidekiq-6.2" do
83
95
  gem "activesupport", "~> 6.1.0"
84
96
  gem "sidekiq", "~> 6.2.0"
85
97
  end
98
+
99
+ appraise "rails-6.1-sidekiq-6.3" do
100
+ gem "activejob", "~> 6.1.0"
101
+ gem "activesupport", "~> 6.1.0"
102
+ gem "sidekiq", "~> 6.3.0"
103
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # sidekiq_publisher
2
2
 
3
+ ## 2.1.0
4
+ - Add support for sidekiq `7.0.0` by using `Sidekiq::Job` instead of
5
+ `Sidekiq::Worker` in sidekiq `>= 6.3.0` to handle name changes outlined in
6
+ mperham/sidekiq#4971 and first introduced in 6.2.2.
7
+
3
8
  ## 2.0.1
4
9
  - Changing the `Job#args` validator to be a manual check instead of using the `exclusions` validator. This is to fix an issue introduced with rails 6.1 and the condition of `in: [nil]`. More details [here](https://github.com/rails/rails/issues/41051).
5
10
 
data/README.md CHANGED
@@ -138,22 +138,23 @@ end
138
138
 
139
139
  #### ActiveJob Exception Reporting
140
140
 
141
- Many exception monitoring service (e.g. Sentry, Airbrake, Honeybadger, etc) already provide basic integration support for `Sidekiq`.
142
- These integration should also work with `SidekiqPublisher`.
143
- However, you may need to explicitly include
141
+ Many exception monitoring service (e.g. Sentry, Airbrake, Honeybadger, etc) already provide basic integration support for `Sidekiq`.
142
+ These integration should also work with `SidekiqPublisher`.
143
+ However, you may need to explicitly include
144
144
  `ActiveJob::QueueAdapters::SidekiqPublisherAdapter` as a compatible adapter for this to work properly.
145
145
 
146
146
  Alternatively, you can manually report the exception:
147
147
 
148
148
  ```ruby
149
149
  retry_on SomeError, attempts: 10 do |_job, exception|
150
- Raven.capture_exception(exception, extra: { custom: :foo }) # Reporting using the Sentry gem
150
+ Raven.capture_exception(exception, extra: { custom: :foo }) # Reporting using the Sentry gem
151
151
  end
152
152
  ```
153
153
 
154
154
  ### SidekiqPublisher::Worker
155
155
 
156
- Sidekiq workers are usually defined by including `Sidekiq::Worker` in a class.
156
+ Sidekiq workers are usually defined by including `Sidekiq::Job` or
157
+ `Sidekiq::Worker` in a class.
157
158
 
158
159
  To use the `SidekiqPublisher`, this can be replaced by including
159
160
  `SidekiqPublisher::Worker`. The usual `perform_async`, etc methods will be
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SidekiqPublisher
4
+ module Compatibility
5
+ class << self
6
+ # Sidekiq::Worker will be renamed to Sidekiq::Job in sidekiq 7.0.0 and a
7
+ # deprecation warning will be printed in sidekiq 6.4.0, per
8
+ # mperham/sidekiq#4971. Sidekiq 6.2.2 (mperham/sidekiq@8e36432) introduces
9
+ # an alias and 6.3.0 includes it when the gem is loaded. This alias is
10
+ # used here to ensure future compatibility.
11
+ def sidekiq_job_class
12
+ @_sidekiq_job_class ||= Gem::Dependency.new("sidekiq", ">= 6.3.0").then do |dependency|
13
+ if dependency.match?(Gem.loaded_specs["sidekiq"])
14
+ Sidekiq::Job
15
+ else
16
+ Sidekiq::Worker
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "2.0.1"
4
+ VERSION = "2.1.0"
5
5
  end
@@ -3,7 +3,7 @@
3
3
  module SidekiqPublisher
4
4
  module Worker
5
5
  def self.included(base)
6
- base.include(Sidekiq::Worker)
6
+ base.include(SidekiqPublisher::Compatibility.sidekiq_job_class)
7
7
  base.singleton_class.public_send(:alias_method, :sidekiq_client_push, :client_push)
8
8
  base.extend(ClassMethods)
9
9
  end
@@ -3,6 +3,7 @@
3
3
  require "active_support"
4
4
  require "active_support/core_ext/numeric/time"
5
5
  require "sidekiq_publisher/version"
6
+ require "sidekiq_publisher/compatibility"
6
7
  require "sidekiq_publisher/instrumenter"
7
8
  require "sidekiq_publisher/metrics_reporter"
8
9
  require "sidekiq_publisher/exception_reporter"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -311,6 +311,7 @@ files:
311
311
  - lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb
312
312
  - lib/sidekiq_publisher.rb
313
313
  - lib/sidekiq_publisher/client.rb
314
+ - lib/sidekiq_publisher/compatibility.rb
314
315
  - lib/sidekiq_publisher/datadog_apm.rb
315
316
  - lib/sidekiq_publisher/engine.rb
316
317
  - lib/sidekiq_publisher/exception_reporter.rb
@@ -345,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
346
  - !ruby/object:Gem::Version
346
347
  version: '0'
347
348
  requirements: []
348
- rubygems_version: 3.0.3
349
+ rubygems_version: 3.1.4
349
350
  signing_key:
350
351
  specification_version: 4
351
352
  summary: Publisher for enqueuing jobs to Sidekiq