sbmt-outbox 6.7.0 → 6.8.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: 799e491b65b103541a47db1bb723e75a5a42ce04a3bbc3e20589310bf45c0601
4
- data.tar.gz: 354049f421f106505186307c73c233d8e11f1f52d8ffd617ce7b4d65ba4ca2c7
3
+ metadata.gz: 7eeda1fb96153d344c166cc65ba9dd8cfcfdfb1402184258e37efff70ec8d2ec
4
+ data.tar.gz: feb94667bbb5777cfc467db6d987f7337fa8da5b7badd09ce59a88a964f71f26
5
5
  SHA512:
6
- metadata.gz: e2d2ead2f3e65f1c5142c4117234ba1e2da76bd37d8e1126c360b1b444e1b89aca41e308fc966804dbcec4329373079cb19fd6fe93f8d05fdb571363d472b2f9
7
- data.tar.gz: 8ff4f833e385c975465eef632e3d234da54e186244fa17f13e7bc89723f67106a601ebe1917dd9cbdba89144638d27d3c54bab07f3da27b3721c47fc2d3187d4
6
+ metadata.gz: 1f095fb1ba849215724ad17e6f1ad27af8cc67674756022f2d4764109ce2231a8b71696b75f8bbb9562bc6754de4daeffae8a5d817588c918f9283d745ce01e8
7
+ data.tar.gz: ad06ba71f618763fca9712d33c298466b586fe84db6f9fe941a3582612a4de930e1e2892cc0a7a3197ff8d6f93bbf0018aa76e0caf47051568debba2f6dc1b7b
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ if ActiveRecord.version >= Gem::Version.new("7.0.0")
4
+ Rails.application.config.active_record.tap do |config|
5
+ config.query_log_tags << {
6
+ box_name: ->(context) { context[:box_item]&.class&.box_name },
7
+ box_item_id: ->(context) { context[:box_item]&.uuid }
8
+ }
9
+ end
10
+ end
@@ -69,6 +69,11 @@ module Sbmt
69
69
  c.batch_process_middlewares.push("Sbmt::Outbox::Middleware::Sentry::TracingBatchProcessMiddleware")
70
70
  c.item_process_middlewares.push("Sbmt::Outbox::Middleware::Sentry::TracingItemProcessMiddleware")
71
71
  end
72
+
73
+ if defined?(ActiveSupport::ExecutionContext)
74
+ require_relative "middleware/execution_context/context_item_process_middleware"
75
+ c.item_process_middlewares.push("Sbmt::Outbox::Middleware::ExecutionContext::ContextItemProcessMiddleware")
76
+ end
72
77
  end
73
78
 
74
79
  rake_tasks do
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sbmt/outbox/middleware/execution_context/context_item_process_middleware"
4
+
5
+ module Sbmt
6
+ module Outbox
7
+ module Middleware
8
+ module ExecutionContext
9
+ class ContextItemProcessMiddleware
10
+ def call(item)
11
+ ActiveSupport::ExecutionContext[:box_item] = item
12
+
13
+ yield
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module Outbox
5
- VERSION = "6.7.0"
5
+ VERSION = "6.8.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.7.0
4
+ version: 6.8.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-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -544,6 +544,7 @@ files:
544
544
  - app/models/sbmt/outbox/outbox_item.rb
545
545
  - app/models/sbmt/outbox/outbox_item_config.rb
546
546
  - app/views/sbmt/outbox/root/index.erb
547
+ - config/initializers/active_record.rb
547
548
  - config/initializers/schked.rb
548
549
  - config/initializers/yabeda.rb
549
550
  - config/routes.rb
@@ -582,6 +583,7 @@ files:
582
583
  - lib/sbmt/outbox/logger.rb
583
584
  - lib/sbmt/outbox/metrics/utils.rb
584
585
  - lib/sbmt/outbox/middleware/builder.rb
586
+ - lib/sbmt/outbox/middleware/execution_context/context_item_process_middleware.rb
585
587
  - lib/sbmt/outbox/middleware/open_telemetry/tracing_create_batch_middleware.rb
586
588
  - lib/sbmt/outbox/middleware/open_telemetry/tracing_create_item_middleware.rb
587
589
  - lib/sbmt/outbox/middleware/open_telemetry/tracing_item_process_middleware.rb
@@ -638,7 +640,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
638
640
  - !ruby/object:Gem::Version
639
641
  version: '0'
640
642
  requirements: []
641
- rubygems_version: 3.5.11
643
+ rubygems_version: 3.5.18
642
644
  signing_key:
643
645
  specification_version: 4
644
646
  summary: Outbox service