builder_apm 0.2.2 → 0.2.3

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: fb49aa255e318beaebed1eb541cd8bf1cf01bd8f5afe9b6ece98323f76952f42
4
- data.tar.gz: c1f282761fa25d4ab0d9ffcdc0a8f8d29932e0696d20a2cede3342cfb8eee6d6
3
+ metadata.gz: 1ce10ef00890d74a1b18ef6afb1644c0983a9ae1a5f5174aadcdcc7957dabba8
4
+ data.tar.gz: 1fc6f2f584168cb7081bd47be58107bbee2d8e3741306c2d3e009ef94118819c
5
5
  SHA512:
6
- metadata.gz: f9ed786df7a7531c8b79a314069bfcfde5a773520b1a603b605096feff55696bdde7b4aba8ab710e5ef9f11782a41ee391de62f0b5237b0273582d3b396aa5cd
7
- data.tar.gz: 25fbcc9f411b55dd3aecf5b593b64d776df83f90b06208c7045daeaf16be8c63e5fec2b452ec664ee212b2c8e8ab23c065f8a47ff3722467bbac6a3f0194de8c
6
+ metadata.gz: 65ce830867f91ccf8ed25a23fd632625e9b3fe8cefcdc9460ffbd0aa666653dc39ee7776d063be82f156c2a29841088c176d0d1002460654fa1d758aefd44251
7
+ data.tar.gz: 217349f4f9cc1f9e094849237dd650b262dbf1d0f43fb721417e05895e2d8ffc80351e425058090044614ee83656313bd8a5ff6889ff32c3387a604bc21d945c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- builder_apm (0.1.0)
4
+ builder_apm (0.2.2)
5
5
  rails (>= 4.0, < 8)
6
6
  redis (~> 4.5)
7
7
 
@@ -66,16 +66,21 @@ module BuilderApm
66
66
  def update_last_sql_query_data_with_instantiation_info(event)
67
67
  stack = Thread.current[:stack]
68
68
  request_id = Thread.current[:request_id]
69
-
69
+
70
70
  return if stack.nil? || stack.empty? || request_id.nil?
71
-
72
- last_sql = Thread.current[:stack].last[:sql_events].pop
73
- if last_sql[:sql_id] == Thread.current[:sql_event_id]
74
- last_sql[:record_count] = event.payload[:record_count]
75
- last_sql[:class_name] = event.payload[:class_name]
71
+
72
+ begin
73
+ last_sql = stack.last[:sql_events].pop
74
+ return unless last_sql && last_sql[:sql_id]
75
+
76
+ if last_sql[:sql_id] == Thread.current[:sql_event_id]
77
+ last_sql[:record_count] = event.payload[:record_count]
78
+ last_sql[:class_name] = event.payload[:class_name]
79
+ end
80
+ Thread.current[:stack].last[:sql_events].push(last_sql)
81
+ ensure
82
+ Thread.current[:sql_event_id] = nil
76
83
  end
77
- Thread.current[:stack].last[:sql_events].push(last_sql)
78
- Thread.current[:sql_event_id] = nil
79
84
  end
80
85
  end
81
86
  end
@@ -1,3 +1,3 @@
1
1
  module BuilderApm
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: builder_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Ketelle