process_handler 0.2.2 → 0.2.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27796e0b0c5f78d0b9e5f00140260a27ea52d407
|
4
|
+
data.tar.gz: 9a76b181eeccd53c18ded6a7acc3f5316838fddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35cedd069cfc542360353dc287ae96c8d8885ac7ff0005e8545ba636bb386c5a430c3d2cb038ac4a3c71db48e68888bc7bd0219c2864f751a89d695f479f6b46
|
7
|
+
data.tar.gz: 0f605b87a6e85783e6da8c57d5b7e43a92b83306ffdb01b4f48675b7265d8bb08882c6f403fd64d3148206994389c5d90614d9ab6d4f48c8224497f19facfd08
|
@@ -115,6 +115,8 @@ module Salemove
|
|
115
115
|
end
|
116
116
|
|
117
117
|
class ServiceSpawner
|
118
|
+
PROCESSED_REQUEST_LOG_KEYS = [:error, :success]
|
119
|
+
|
118
120
|
def self.spawn(service, messenger, exception_notifier)
|
119
121
|
new(service, messenger, exception_notifier).spawn
|
120
122
|
end
|
@@ -170,17 +172,20 @@ module Salemove
|
|
170
172
|
handle_exception(exception, input)
|
171
173
|
end
|
172
174
|
|
173
|
-
PROCESSED_REQUEST_LOG_KEYS = [:error, :success]
|
174
|
-
|
175
175
|
def delegate_to_service(input)
|
176
|
-
request_id = input[:request_id]
|
177
176
|
result = PivotProcess.benchmark(input) { @service.call(input) }
|
178
|
-
|
179
|
-
"Processed request", result.select{|k, _| PROCESSED_REQUEST_LOG_KEYS.include?(k)}.merge(request_id: request_id)
|
180
|
-
)
|
177
|
+
log_processed_request(input, result)
|
181
178
|
result
|
182
179
|
end
|
183
180
|
|
181
|
+
def log_processed_request(input, result)
|
182
|
+
attributes = result
|
183
|
+
.select {|k, _| PROCESSED_REQUEST_LOG_KEYS.include?(k)}
|
184
|
+
.merge(request_id: input[:request_id], type: input[:type])
|
185
|
+
|
186
|
+
PivotProcess.logger.info "Processed request", attributes
|
187
|
+
end
|
188
|
+
|
184
189
|
def handle_exception(e, input)
|
185
190
|
PivotProcess.logger.error(e.inspect + "\n" + e.backtrace.join("\n"), request_id: input[:request_id])
|
186
191
|
if @exception_notifier
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: process_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Indrek Juhkam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.4.
|
119
|
+
rubygems_version: 2.4.5.1
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: ''
|