sbmt-outbox 6.4.3 → 6.5.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: 17535824e7b8a62fa7695b25c1be0b53b0bcfb7bff9b8015fec31aaed28ca95b
4
- data.tar.gz: d668f93fe5109170fc1571bd88ccf503f3bc776e406fc32d3ffe1ec130097a8d
3
+ metadata.gz: e88f22ff7adf6d76e9fb116d0de7d825986114fc4e68a289e286c5e3d9d24fde
4
+ data.tar.gz: f3ec1429fba3c58bc741ab2c6ebbe9cc1483716cc703a76385c90c09f1e70e24
5
5
  SHA512:
6
- metadata.gz: 80ce2a3aad22f1fa4244d4a86fe8682858abe605bfcf8ac2751a8688fad87f14f7cc141f6ead9ea4e8e47137d95639d3d984724dac31867a4878881f90054786
7
- data.tar.gz: 4dca4cbe2d50415fcf76f5db3243484ad52e9adfbb0a9ac6947bd1cd134e50558cba7432a20782dd5fdd91c95185005312602fefda976a7c48a4b9e0969abde8
6
+ metadata.gz: a4afedde029080834e7d379402c7832b5d6dfaa6c1d86c25b38358bc95fb9b7db2d1ade8458a2b28750f2a6a8247bede8838198a7b15cb1397b944f6a0e4b174
7
+ data.tar.gz: 7524112c3ec1e28a594af7fd44bd7cb18bd0e52dc199fa6c327314245e3ca41160aaf28922d94cdedb59c56f7faf528871a216f0d02dae11023c599f62bb2acf
@@ -64,9 +64,12 @@ module Sbmt
64
64
  def delete_stale_items(waterline)
65
65
  logger.log_info("Start deleting #{box_type} items for #{box_name} older than #{waterline}")
66
66
 
67
- scope = item_class.where("created_at < ?", waterline)
67
+ loop do
68
+ ids = Outbox.database_switcher.use_slave do
69
+ item_class.where("created_at < ?", waterline).limit(BATCH_SIZE).ids
70
+ end
71
+ break if ids.empty?
68
72
 
69
- while (ids = scope.limit(BATCH_SIZE).ids).present?
70
73
  item_class.where(id: ids).delete_all
71
74
  sleep SLEEP_TIME
72
75
  end
@@ -94,7 +94,7 @@ module Sbmt
94
94
  end
95
95
  end
96
96
  rescue Cutoff::CutoffExceededError
97
- box_worker.job_timeout_counter.increment(labels)
97
+ box_worker.job_timeout_counter.increment(task.yabeda_labels)
98
98
  logger.log_info("Lock timeout while processing #{task.resource_key} at id #{last_id}")
99
99
  end
100
100
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module Outbox
5
- VERSION = "6.4.3"
5
+ VERSION = "6.5.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.4.3
4
+ version: 6.5.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-05-16 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -636,7 +636,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
636
636
  - !ruby/object:Gem::Version
637
637
  version: '0'
638
638
  requirements: []
639
- rubygems_version: 3.1.6
639
+ rubygems_version: 3.5.11
640
640
  signing_key:
641
641
  specification_version: 4
642
642
  summary: Outbox service