sbmt-outbox 6.19.0 → 6.19.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2388c5b92575f95604799a724ff87edba32ad630c3f12bd194c5798a32c2b77e
|
4
|
+
data.tar.gz: 8180f941d28cb36773e627c147285cda718c8be4c175649ddeaa94087153ccd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 453412ec8a80104a64f70c2fbbc4fff612ab1b0294047515865a3434caed9808ddf9fd8ba3ee1feb4e924eb65ef5e197fcbbdbbec84c4ba04a2d1014e28a5e30
|
7
|
+
data.tar.gz: a76efc7b0026ad182abcc785159dfcdba4236f314bf310210bdf7ed8c234b0d3b5c60911f3218c1901c2d5557d1b04217efb713a2787e1431e47fe7344167400
|
@@ -118,7 +118,10 @@ module Sbmt
|
|
118
118
|
batch_size = item_class.config.deletion_batch_size
|
119
119
|
time_window = item_class.config.deletion_time_window
|
120
120
|
min_date = Outbox.database_switcher.use_slave do
|
121
|
-
|
121
|
+
# This query assumes that record with minimum 'id' also has minimum 'created_at'.
|
122
|
+
# We use it because it should be faster than plain 'SELECT MIN(created_at) ...'.
|
123
|
+
min_id = item_class.select(table[:id].minimum).where(status: statuses)
|
124
|
+
item_class.select(:created_at).where(table[:id].eq(min_id.arel)).first&.created_at
|
122
125
|
end
|
123
126
|
deleted_count = nil
|
124
127
|
|
@@ -174,10 +177,14 @@ module Sbmt
|
|
174
177
|
end
|
175
178
|
|
176
179
|
def delete_items_in_batches_with_between_mysql(waterline, statuses)
|
180
|
+
table = item_class.arel_table
|
177
181
|
batch_size = item_class.config.deletion_batch_size
|
178
182
|
time_window = item_class.config.deletion_time_window
|
179
183
|
min_date = Outbox.database_switcher.use_slave do
|
180
|
-
|
184
|
+
# This query assumes that record with minimum 'id' also has minimum 'created_at'.
|
185
|
+
# We use it because plain 'SELECT MIN(created_at) ...' is VERY slow in MySQL.
|
186
|
+
min_id = item_class.select(table[:id].minimum).where(status: statuses)
|
187
|
+
item_class.select(:created_at).where(table[:id].eq(min_id.arel)).first&.created_at
|
181
188
|
end
|
182
189
|
deleted_count = nil
|
183
190
|
|
data/lib/sbmt/outbox/version.rb
CHANGED
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.19.
|
4
|
+
version: 6.19.2
|
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: 2025-
|
11
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|