sbmt-outbox 6.10.5 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44e7fd575f780f405d0aea05415627bab8f9a566bd0417d8a1564bd784564be5
4
- data.tar.gz: fff1b10a605751abd0e0f1c87da31710176ea39df22d1527f794aef4ca78dd4b
3
+ metadata.gz: 9e410e7a4507b5470d10986ac8d9949c4c9460a6773a97063b0287d9e777c4d9
4
+ data.tar.gz: ef17da6564faeb5f17cee5073cbecebeca083a555a9c046d0794f210f1a1b414
5
5
  SHA512:
6
- metadata.gz: 5730bdd718b6e87fb6f0b44b30d3d6e37fa9baf851eaab8c61c4a2c9fd430ed165e3272c11b06647538e09281cd0ad30d247959f24f40ec79370a6b5b05c80fc
7
- data.tar.gz: 18c56bd8ca7a5004875d309cd2178ab2ddb91eaacd7b5535c0b989ad1ba427711f99129ef47ff59d53c54ad21df4a6bb0391488bde2e0b212615eb48819198ab
6
+ metadata.gz: 1e5fa1c14bab5bee90e4f5c664c22cdc5e8bea8fcfca391a3eb967ddf1c3b57b96080ab147cf366e5cbc9d2add8d486b8b2ca5ebfe8c9e96d0e989ab27ae685d
7
+ data.tar.gz: c47678da77b2f59787dd64cd162974b7cd4f6954fc2fafae54614b930fcf44068498491aaddae77d99b86f50dc67637b2090ae7d155a844ca193b9f011cf7189
@@ -134,7 +134,7 @@ module Sbmt
134
134
  def mysql_delete_in_batches(waterline)
135
135
  loop do
136
136
  deleted_count = item_class
137
- .where("created_at < ?", waterline)
137
+ .where(created_at: ...waterline)
138
138
  .limit(BATCH_SIZE)
139
139
  .delete_all
140
140
 
@@ -1,8 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../../../../lib/sbmt/outbox/enum_refinement"
4
+
3
5
  module Sbmt
4
6
  module Outbox
5
7
  class BaseItem < Outbox.active_record_base_class
8
+ # For compatibility with rails < 7
9
+ # Remove when drop support of Rails < 7
10
+ using EnumRefinement
11
+
6
12
  self.abstract_class = true
7
13
 
8
14
  class << self
@@ -26,8 +32,8 @@ module Sbmt
26
32
 
27
33
  def calc_bucket_partitions(count)
28
34
  (0...count).to_a
29
- .each_with_object({}) do |x, m|
30
- m[x] = (0...config.bucket_size).to_a
35
+ .index_with do |x|
36
+ (0...config.bucket_size).to_a
31
37
  .select { |p| p % count == x }
32
38
  end
33
39
  end
@@ -46,7 +52,7 @@ module Sbmt
46
52
  end
47
53
  end
48
54
 
49
- enum status: {
55
+ enum :status, {
50
56
  pending: 0,
51
57
  failed: 1,
52
58
  delivered: 2,
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sbmt
4
+ module Outbox
5
+ module EnumRefinement
6
+ refine ActiveRecord::Base.singleton_class do
7
+ def enum(name, values = nil)
8
+ if Rails::VERSION::MAJOR >= 7
9
+ super
10
+ else
11
+ super(name => values)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module Outbox
5
- VERSION = "6.10.5"
5
+ VERSION = "6.11.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbmt-outbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.10.5
4
+ version: 6.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sbermarket Ruby-Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-05 00:00:00.000000000 Z
11
+ date: 2024-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -86,20 +86,20 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '5.2'
89
+ version: '6.0'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: '8'
92
+ version: '8.1'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: '5.2'
99
+ version: '6.0'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: '8'
102
+ version: '8.1'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: yabeda
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -563,6 +563,7 @@ files:
563
563
  - lib/sbmt/outbox/cli.rb
564
564
  - lib/sbmt/outbox/database_switcher.rb
565
565
  - lib/sbmt/outbox/engine.rb
566
+ - lib/sbmt/outbox/enum_refinement.rb
566
567
  - lib/sbmt/outbox/error_tracker.rb
567
568
  - lib/sbmt/outbox/errors.rb
568
569
  - lib/sbmt/outbox/instrumentation/open_telemetry_loader.rb
@@ -626,7 +627,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
626
627
  - !ruby/object:Gem::Version
627
628
  version: '0'
628
629
  requirements: []
629
- rubygems_version: 3.5.21
630
+ rubygems_version: 3.1.6
630
631
  signing_key:
631
632
  specification_version: 4
632
633
  summary: Outbox service