sidekiq_publisher 3.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +20 -20
- data/CHANGELOG.md +7 -0
- data/README.md +5 -0
- data/gemfiles/rails_6.1_sidekiq_6.4.gemfile +1 -1
- data/gemfiles/{rails_6.1_sidekiq_5.2.gemfile → rails_6.1_sidekiq_6.5.gemfile} +1 -1
- data/gemfiles/{rails_6.1_sidekiq_6.0.gemfile → rails_7.0_sidekiq_6.4.gemfile} +3 -3
- data/gemfiles/{rails_6.1_sidekiq_6.1.gemfile → rails_7.0_sidekiq_6.5.gemfile} +3 -3
- data/gemfiles/{rails_6.1_sidekiq_6.2.gemfile → rails_7.1_sidekiq_6.4.gemfile} +3 -3
- data/gemfiles/rails_7.1_sidekiq_6.5.gemfile +9 -0
- data/lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb +16 -3
- data/lib/sidekiq_publisher/database_connection.rb +9 -0
- data/lib/sidekiq_publisher/version.rb +1 -1
- data/lib/sidekiq_publisher/worker.rb +5 -1
- data/lib/sidekiq_publisher.rb +1 -0
- data/sidekiq_publisher.gemspec +2 -2
- metadata +13 -12
- data/gemfiles/rails_6.1_sidekiq_6.3.gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c19a1a0814263440df5e67a3fccbfcde9db9dd1e157f0fa338b8a39a2c72469d
|
4
|
+
data.tar.gz: 63863dfadce1cba213ec980e8f9eaf2d73a7b63a38a7bb99e608475fb57fbd00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d33b65bd3bf779451172474eff1b87b1552aefd8858aa3614bdb755710aded386b7909b31f1aba4d708868828dbfdda2ed676a01781fa2034772fe5cdd1afa
|
7
|
+
data.tar.gz: 5c16c2f64f50b68345a341cabb032c34f7afc4dca02c0d048880e2bb4d9dc6603edeacf86f1e7e2c83c9ed0a42d75720425ba122b2994a6f718abc1a34305ae4
|
data/Appraisals
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise "rails-6.1-sidekiq-
|
3
|
+
appraise "rails-6.1-sidekiq-6.4" do
|
4
4
|
gem "activejob", "~> 6.1.0"
|
5
5
|
gem "activesupport", "~> 6.1.0"
|
6
|
-
gem "sidekiq", "~>
|
6
|
+
gem "sidekiq", "~> 6.4.1"
|
7
7
|
end
|
8
8
|
|
9
|
-
appraise "rails-6.1-sidekiq-6.
|
9
|
+
appraise "rails-6.1-sidekiq-6.5" do
|
10
10
|
gem "activejob", "~> 6.1.0"
|
11
11
|
gem "activesupport", "~> 6.1.0"
|
12
|
-
gem "sidekiq", "~> 6.0
|
12
|
+
gem "sidekiq", "~> 6.5.0"
|
13
13
|
end
|
14
14
|
|
15
|
-
appraise "rails-
|
16
|
-
gem "activejob", "~>
|
17
|
-
gem "activesupport", "~>
|
18
|
-
gem "sidekiq", "~> 6.1
|
15
|
+
appraise "rails-7.0-sidekiq-6.4" do
|
16
|
+
gem "activejob", "~> 7.0.0"
|
17
|
+
gem "activesupport", "~> 7.0.0"
|
18
|
+
gem "sidekiq", "~> 6.4.1"
|
19
19
|
end
|
20
20
|
|
21
|
-
appraise "rails-
|
22
|
-
gem "activejob", "~>
|
23
|
-
gem "activesupport", "~>
|
24
|
-
gem "sidekiq", "~> 6.
|
21
|
+
appraise "rails-7.0-sidekiq-6.5" do
|
22
|
+
gem "activejob", "~> 7.0.0"
|
23
|
+
gem "activesupport", "~> 7.0.0"
|
24
|
+
gem "sidekiq", "~> 6.5.0"
|
25
25
|
end
|
26
26
|
|
27
|
-
appraise "rails-
|
28
|
-
gem "activejob", "~>
|
29
|
-
gem "activesupport", "~>
|
30
|
-
gem "sidekiq", "~> 6.
|
27
|
+
appraise "rails-7.1-sidekiq-6.4" do
|
28
|
+
gem "activejob", "~> 7.1.0"
|
29
|
+
gem "activesupport", "~> 7.1.0"
|
30
|
+
gem "sidekiq", "~> 6.4.1"
|
31
31
|
end
|
32
32
|
|
33
|
-
appraise "rails-
|
34
|
-
gem "activejob", "~>
|
35
|
-
gem "activesupport", "~>
|
36
|
-
gem "sidekiq", "~> 6.
|
33
|
+
appraise "rails-7.1-sidekiq-6.5" do
|
34
|
+
gem "activejob", "~> 7.1.0"
|
35
|
+
gem "activesupport", "~> 7.1.0"
|
36
|
+
gem "sidekiq", "~> 6.5.0"
|
37
37
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# sidekiq_publisher
|
2
2
|
|
3
|
+
## 5.0.0
|
4
|
+
- BREAKING: Drop support for Sidekiq < 6.1.
|
5
|
+
- Add support for ActiveSupport and ActiveJob 7.1
|
6
|
+
|
7
|
+
## 4.0.0
|
8
|
+
- BREAKING: Enqueue directly to Redis unless in a transaction ([#74](https://github.com/ezcater/sidekiq_publisher/pull/74/))
|
9
|
+
|
3
10
|
## 3.0.0
|
4
11
|
- BREAKING: Drop support for Ruby `2.6` and `2.7` as they are [past end of life](https://endoflife.date/ruby)
|
5
12
|
- BREAKING: Drop support for `ddtrace <= 1.8.0`
|
data/README.md
CHANGED
@@ -16,6 +16,11 @@ that modifies the system of record for the application. It also allows jobs to
|
|
16
16
|
be created even when Sidekiq/Redis is temporarily unavailable. The separate
|
17
17
|
publisher process handles retries and ensure that each job is delivered to Sidekiq.
|
18
18
|
|
19
|
+
> :warning: Not all jobs are staged in Postgres. This is determined dynamically:
|
20
|
+
> if the job is enqueued from within an `ActiveRecord` transaction, then it is
|
21
|
+
> staged in Postgres. If not, then it bypasses Postgres and is enqueued directly
|
22
|
+
> to Redis via Sidekiq.
|
23
|
+
|
19
24
|
## Installation
|
20
25
|
|
21
26
|
Add this line to your application's Gemfile:
|
@@ -11,19 +11,28 @@ module ActiveJob
|
|
11
11
|
JOB_WRAPPER_CLASS = ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper.to_s.freeze
|
12
12
|
|
13
13
|
def enqueue(job)
|
14
|
-
|
14
|
+
if SidekiqPublisher::DatabaseConnection.transaction_open?
|
15
|
+
create_job_record(job)
|
16
|
+
else
|
17
|
+
sidekiq_adapter.enqueue(job)
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
def enqueue_at(job, timestamp)
|
18
|
-
|
22
|
+
if SidekiqPublisher::DatabaseConnection.transaction_open?
|
23
|
+
create_job_record(job, timestamp)
|
24
|
+
else
|
25
|
+
sidekiq_adapter.enqueue_at(job, timestamp)
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
private
|
22
30
|
|
23
|
-
def
|
31
|
+
def create_job_record(job, timestamp = nil)
|
24
32
|
job.provider_job_id = SidekiqPublisher::Job.generate_sidekiq_jid
|
25
33
|
attributes = job_attributes(job)
|
26
34
|
attributes[:run_at] = timestamp if timestamp.present?
|
35
|
+
|
27
36
|
SidekiqPublisher::Job.create!(attributes).job_id
|
28
37
|
end
|
29
38
|
|
@@ -36,6 +45,10 @@ module ActiveJob
|
|
36
45
|
args: [job.serialize],
|
37
46
|
}
|
38
47
|
end
|
48
|
+
|
49
|
+
def sidekiq_adapter
|
50
|
+
@_sidekiq_adapter ||= ActiveJob::QueueAdapters::SidekiqAdapter.new
|
51
|
+
end
|
39
52
|
end
|
40
53
|
end
|
41
54
|
end
|
@@ -10,7 +10,11 @@ module SidekiqPublisher
|
|
10
10
|
|
11
11
|
module ClassMethods
|
12
12
|
def client_push(item)
|
13
|
-
SidekiqPublisher::
|
13
|
+
if SidekiqPublisher::DatabaseConnection.transaction_open?
|
14
|
+
SidekiqPublisher::Job.create_job!(item)
|
15
|
+
else
|
16
|
+
super
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
data/lib/sidekiq_publisher.rb
CHANGED
@@ -4,6 +4,7 @@ require "active_support"
|
|
4
4
|
require "active_support/core_ext/numeric/time"
|
5
5
|
require "sidekiq_publisher/version"
|
6
6
|
require "sidekiq_publisher/compatibility"
|
7
|
+
require "sidekiq_publisher/database_connection"
|
7
8
|
require "sidekiq_publisher/instrumenter"
|
8
9
|
require "sidekiq_publisher/metrics_reporter"
|
9
10
|
require "sidekiq_publisher/exception_reporter"
|
data/sidekiq_publisher.gemspec
CHANGED
@@ -60,6 +60,6 @@ Gem::Specification.new do |spec|
|
|
60
60
|
spec.add_development_dependency "simplecov", "< 0.18"
|
61
61
|
|
62
62
|
spec.add_runtime_dependency "activerecord-postgres_pub_sub", ">= 0.4.0"
|
63
|
-
spec.add_runtime_dependency "activesupport", ">= 6.1", "< 7.
|
64
|
-
spec.add_runtime_dependency "sidekiq", ">=
|
63
|
+
spec.add_runtime_dependency "activesupport", ">= 6.1", "< 7.2"
|
64
|
+
spec.add_runtime_dependency "sidekiq", ">= 6.4.1", "< 7"
|
65
65
|
end
|
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:
|
4
|
+
version: 5.0.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:
|
11
|
+
date: 2024-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -249,7 +249,7 @@ dependencies:
|
|
249
249
|
version: '6.1'
|
250
250
|
- - "<"
|
251
251
|
- !ruby/object:Gem::Version
|
252
|
-
version: '7.
|
252
|
+
version: '7.2'
|
253
253
|
type: :runtime
|
254
254
|
prerelease: false
|
255
255
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -259,14 +259,14 @@ dependencies:
|
|
259
259
|
version: '6.1'
|
260
260
|
- - "<"
|
261
261
|
- !ruby/object:Gem::Version
|
262
|
-
version: '7.
|
262
|
+
version: '7.2'
|
263
263
|
- !ruby/object:Gem::Dependency
|
264
264
|
name: sidekiq
|
265
265
|
requirement: !ruby/object:Gem::Requirement
|
266
266
|
requirements:
|
267
267
|
- - ">="
|
268
268
|
- !ruby/object:Gem::Version
|
269
|
-
version:
|
269
|
+
version: 6.4.1
|
270
270
|
- - "<"
|
271
271
|
- !ruby/object:Gem::Version
|
272
272
|
version: '7'
|
@@ -276,7 +276,7 @@ dependencies:
|
|
276
276
|
requirements:
|
277
277
|
- - ">="
|
278
278
|
- !ruby/object:Gem::Version
|
279
|
-
version:
|
279
|
+
version: 6.4.1
|
280
280
|
- - "<"
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: '7'
|
@@ -297,18 +297,19 @@ files:
|
|
297
297
|
- LICENSE.txt
|
298
298
|
- README.md
|
299
299
|
- app/models/sidekiq_publisher/job.rb
|
300
|
-
- gemfiles/rails_6.1_sidekiq_5.2.gemfile
|
301
|
-
- gemfiles/rails_6.1_sidekiq_6.0.gemfile
|
302
|
-
- gemfiles/rails_6.1_sidekiq_6.1.gemfile
|
303
|
-
- gemfiles/rails_6.1_sidekiq_6.2.gemfile
|
304
|
-
- gemfiles/rails_6.1_sidekiq_6.3.gemfile
|
305
300
|
- gemfiles/rails_6.1_sidekiq_6.4.gemfile
|
301
|
+
- gemfiles/rails_6.1_sidekiq_6.5.gemfile
|
302
|
+
- gemfiles/rails_7.0_sidekiq_6.4.gemfile
|
303
|
+
- gemfiles/rails_7.0_sidekiq_6.5.gemfile
|
304
|
+
- gemfiles/rails_7.1_sidekiq_6.4.gemfile
|
305
|
+
- gemfiles/rails_7.1_sidekiq_6.5.gemfile
|
306
306
|
- lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb
|
307
307
|
- lib/generators/sidekiq_publisher/install_generator.rb
|
308
308
|
- lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb
|
309
309
|
- lib/sidekiq_publisher.rb
|
310
310
|
- lib/sidekiq_publisher/client.rb
|
311
311
|
- lib/sidekiq_publisher/compatibility.rb
|
312
|
+
- lib/sidekiq_publisher/database_connection.rb
|
312
313
|
- lib/sidekiq_publisher/datadog_apm.rb
|
313
314
|
- lib/sidekiq_publisher/engine.rb
|
314
315
|
- lib/sidekiq_publisher/exception_reporter.rb
|
@@ -344,7 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
345
|
- !ruby/object:Gem::Version
|
345
346
|
version: '0'
|
346
347
|
requirements: []
|
347
|
-
rubygems_version: 3.
|
348
|
+
rubygems_version: 3.4.16
|
348
349
|
signing_key:
|
349
350
|
specification_version: 4
|
350
351
|
summary: Publisher for enqueuing jobs to Sidekiq
|