sidekiq_publisher 5.0.0 → 6.0.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: c19a1a0814263440df5e67a3fccbfcde9db9dd1e157f0fa338b8a39a2c72469d
4
- data.tar.gz: 63863dfadce1cba213ec980e8f9eaf2d73a7b63a38a7bb99e608475fb57fbd00
3
+ metadata.gz: 5d694726b7f22c4d22b2994c73c905981740a2ee6c487bb6ae815c793d766725
4
+ data.tar.gz: 1fe7ccd8338205c1472c6e7ce8e544c848289a31fd1ba9fa64a93bc7699c9a87
5
5
  SHA512:
6
- metadata.gz: 93d33b65bd3bf779451172474eff1b87b1552aefd8858aa3614bdb755710aded386b7909b31f1aba4d708868828dbfdda2ed676a01781fa2034772fe5cdd1afa
7
- data.tar.gz: 5c16c2f64f50b68345a341cabb032c34f7afc4dca02c0d048880e2bb4d9dc6603edeacf86f1e7e2c83c9ed0a42d75720425ba122b2994a6f718abc1a34305ae4
6
+ metadata.gz: 31289860faedbc39cc671f59222d15b66558d61a18c32f3318283d15a01a61a50048ae3edbecd259186483c9684ff4f64f2cb6b0c44ee6f33c3f970613beb7eb
7
+ data.tar.gz: 5fe476a56e27cf5b8a16b71faaf3ac50df0e62c11165f358abca361687aea54254663c9f0cf7f89351269d8ff4ee63dd44baca87d1db6f78c6923a0ecb4286f1
data/.github/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @ezcater/demand-scalability
1
+ * @ezcater/monolith-experience
data/Appraisals CHANGED
@@ -2,36 +2,42 @@
2
2
 
3
3
  appraise "rails-6.1-sidekiq-6.4" do
4
4
  gem "activejob", "~> 6.1.0"
5
+ gem "activerecord", "~> 6.1.0"
5
6
  gem "activesupport", "~> 6.1.0"
6
7
  gem "sidekiq", "~> 6.4.1"
7
8
  end
8
9
 
9
10
  appraise "rails-6.1-sidekiq-6.5" do
10
11
  gem "activejob", "~> 6.1.0"
12
+ gem "activerecord", "~> 6.1.0"
11
13
  gem "activesupport", "~> 6.1.0"
12
14
  gem "sidekiq", "~> 6.5.0"
13
15
  end
14
16
 
15
17
  appraise "rails-7.0-sidekiq-6.4" do
16
18
  gem "activejob", "~> 7.0.0"
19
+ gem "activerecord", "~> 7.0.0"
17
20
  gem "activesupport", "~> 7.0.0"
18
21
  gem "sidekiq", "~> 6.4.1"
19
22
  end
20
23
 
21
24
  appraise "rails-7.0-sidekiq-6.5" do
22
25
  gem "activejob", "~> 7.0.0"
26
+ gem "activerecord", "~> 7.0.0"
23
27
  gem "activesupport", "~> 7.0.0"
24
28
  gem "sidekiq", "~> 6.5.0"
25
29
  end
26
30
 
27
31
  appraise "rails-7.1-sidekiq-6.4" do
28
32
  gem "activejob", "~> 7.1.0"
33
+ gem "activerecord", "~> 7.1.0"
29
34
  gem "activesupport", "~> 7.1.0"
30
35
  gem "sidekiq", "~> 6.4.1"
31
36
  end
32
37
 
33
38
  appraise "rails-7.1-sidekiq-6.5" do
34
39
  gem "activejob", "~> 7.1.0"
40
+ gem "activerecord", "~> 7.1.0"
35
41
  gem "activesupport", "~> 7.1.0"
36
42
  gem "sidekiq", "~> 6.5.0"
37
43
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # sidekiq_publisher
2
2
 
3
+ ## 6.0.0
4
+ - BREAKING: Remove SidekiqPublisher::DatabaseConnection.transaction_open? method
5
+ - Add stage_to_database_outside_transaction configuration option
6
+
3
7
  ## 5.0.0
4
8
  - BREAKING: Drop support for Sidekiq < 6.1.
5
9
  - Add support for ActiveSupport and ActiveJob 7.1
data/README.md CHANGED
@@ -19,7 +19,8 @@ publisher process handles retries and ensure that each job is delivered to Sidek
19
19
  > :warning: Not all jobs are staged in Postgres. This is determined dynamically:
20
20
  > if the job is enqueued from within an `ActiveRecord` transaction, then it is
21
21
  > staged in Postgres. If not, then it bypasses Postgres and is enqueued directly
22
- > to Redis via Sidekiq.
22
+ > to Redis via Sidekiq. To opt out of this behavior configure with
23
+ > SidekiqPublisher.configure { |c| c.stage_to_database_outside_transaction = true }
23
24
 
24
25
  ## Installation
25
26
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 6.1.0"
6
+ gem "activerecord", "~> 6.1.0"
6
7
  gem "activesupport", "~> 6.1.0"
7
8
  gem "sidekiq", "~> 6.4.1"
8
9
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 6.1.0"
6
+ gem "activerecord", "~> 6.1.0"
6
7
  gem "activesupport", "~> 6.1.0"
7
8
  gem "sidekiq", "~> 6.5.0"
8
9
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 7.0.0"
6
+ gem "activerecord", "~> 7.0.0"
6
7
  gem "activesupport", "~> 7.0.0"
7
8
  gem "sidekiq", "~> 6.4.1"
8
9
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 7.0.0"
6
+ gem "activerecord", "~> 7.0.0"
6
7
  gem "activesupport", "~> 7.0.0"
7
8
  gem "sidekiq", "~> 6.5.0"
8
9
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 7.1.0"
6
+ gem "activerecord", "~> 7.1.0"
6
7
  gem "activesupport", "~> 7.1.0"
7
8
  gem "sidekiq", "~> 6.4.1"
8
9
 
@@ -3,6 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activejob", "~> 7.1.0"
6
+ gem "activerecord", "~> 7.1.0"
6
7
  gem "activesupport", "~> 7.1.0"
7
8
  gem "sidekiq", "~> 6.5.0"
8
9
 
@@ -11,7 +11,7 @@ module ActiveJob
11
11
  JOB_WRAPPER_CLASS = ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper.to_s.freeze
12
12
 
13
13
  def enqueue(job)
14
- if SidekiqPublisher::DatabaseConnection.transaction_open?
14
+ if SidekiqPublisher::DatabaseConnection.should_stage_to_database?
15
15
  create_job_record(job)
16
16
  else
17
17
  sidekiq_adapter.enqueue(job)
@@ -19,7 +19,7 @@ module ActiveJob
19
19
  end
20
20
 
21
21
  def enqueue_at(job, timestamp)
22
- if SidekiqPublisher::DatabaseConnection.transaction_open?
22
+ if SidekiqPublisher::DatabaseConnection.should_stage_to_database?
23
23
  create_job_record(job, timestamp)
24
24
  else
25
25
  sidekiq_adapter.enqueue_at(job, timestamp)
@@ -2,8 +2,9 @@
2
2
 
3
3
  module SidekiqPublisher
4
4
  module DatabaseConnection
5
- def self.transaction_open?
6
- ActiveRecord::Base.connection.transaction_open?
5
+ def self.should_stage_to_database?
6
+ SidekiqPublisher.stage_to_database_outside_transaction ||
7
+ ActiveRecord::Base.connection.transaction_open?
7
8
  end
8
9
  end
9
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "5.0.0"
4
+ VERSION = "6.0.0"
5
5
  end
@@ -10,7 +10,7 @@ module SidekiqPublisher
10
10
 
11
11
  module ClassMethods
12
12
  def client_push(item)
13
- if SidekiqPublisher::DatabaseConnection.transaction_open?
13
+ if SidekiqPublisher::DatabaseConnection.should_stage_to_database?
14
14
  SidekiqPublisher::Job.create_job!(item)
15
15
  else
16
16
  super
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # FIXES: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
4
+ require "logger"
5
+ require "active_record"
3
6
  require "active_support"
4
7
  require "active_support/core_ext/numeric/time"
5
8
  require "sidekiq_publisher/version"
@@ -19,7 +22,7 @@ module SidekiqPublisher
19
22
  DEFAULT_JOB_RETENTION_PERIOD = 1.day.freeze
20
23
 
21
24
  class << self
22
- attr_accessor :logger, :exception_reporter, :metrics_reporter
25
+ attr_accessor :logger, :exception_reporter, :metrics_reporter, :stage_to_database_outside_transaction
23
26
  attr_writer :batch_size, :job_retention_period
24
27
 
25
28
  def configure
@@ -36,6 +39,7 @@ module SidekiqPublisher
36
39
 
37
40
  # For test purposes
38
41
  def reset!
42
+ @stage_to_database_outside_transaction = nil
39
43
  @batch_size = nil
40
44
  @job_retention_period = nil
41
45
  @exception_reporter = nil
@@ -59,6 +59,7 @@ Gem::Specification.new do |spec|
59
59
  spec.add_development_dependency "shoulda-matchers"
60
60
  spec.add_development_dependency "simplecov", "< 0.18"
61
61
 
62
+ spec.add_runtime_dependency "activerecord", ">= 6.1", "< 7.2"
62
63
  spec.add_runtime_dependency "activerecord-postgres_pub_sub", ">= 0.4.0"
63
64
  spec.add_runtime_dependency "activesupport", ">= 6.1", "< 7.2"
64
65
  spec.add_runtime_dependency "sidekiq", ">= 6.4.1", "< 7"
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: 5.0.0
4
+ version: 6.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: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -226,6 +226,26 @@ dependencies:
226
226
  - - "<"
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0.18'
229
+ - !ruby/object:Gem::Dependency
230
+ name: activerecord
231
+ requirement: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '6.1'
236
+ - - "<"
237
+ - !ruby/object:Gem::Version
238
+ version: '7.2'
239
+ type: :runtime
240
+ prerelease: false
241
+ version_requirements: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ version: '6.1'
246
+ - - "<"
247
+ - !ruby/object:Gem::Version
248
+ version: '7.2'
229
249
  - !ruby/object:Gem::Dependency
230
250
  name: activerecord-postgres_pub_sub
231
251
  requirement: !ruby/object:Gem::Requirement
@@ -345,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
365
  - !ruby/object:Gem::Version
346
366
  version: '0'
347
367
  requirements: []
348
- rubygems_version: 3.4.16
368
+ rubygems_version: 3.5.22
349
369
  signing_key:
350
370
  specification_version: 4
351
371
  summary: Publisher for enqueuing jobs to Sidekiq