process_handler 0.2.8 → 0.2.9
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42e47422baa38b9c91c4bbaff699373e903c6f01
|
4
|
+
data.tar.gz: 5378e9443a93f92a57cb83ea6c69197b6ec9ae6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9e25775c634f4bd5a41c3dde5ede86888c1222e396ad871f74f6999c5ef010cf1accd6a209c053658aa1dffe953325a04bb7aa6e17174fe87ba8ca1990f057b
|
7
|
+
data.tar.gz: 401159f363f22948e273b396a3795139cf5879a6e27d5225301a06876cd668c2fb638cef21eb660dc6990a30ef9366939e6b785ae05b7f9eb56f9df4c9072496
|
data/Gemfile
CHANGED
@@ -149,6 +149,7 @@ module Salemove
|
|
149
149
|
end
|
150
150
|
end
|
151
151
|
rescue Timeout::Error
|
152
|
+
PivotProcess.logger.error "Fullfillable response was not fulfilled in #{timeout} seconds", input
|
152
153
|
handle_response(handler, success: false, error: "Fulfillable response was not fulfilled")
|
153
154
|
end
|
154
155
|
|
@@ -62,7 +62,7 @@ describe ProcessHandler::CronProcess do
|
|
62
62
|
describe 'exception handler' do
|
63
63
|
let(:process) { ProcessHandler::CronProcess.new(params) }
|
64
64
|
let(:params) {{ env: 'test', notifier_factory: notifier_factory,
|
65
|
-
scheduler_options: {frequency: 0.
|
65
|
+
scheduler_options: {frequency: 0.2} }}
|
66
66
|
let(:notifier_factory) { double('NotifierFactory') }
|
67
67
|
let(:exception_notifier) { double('Airbrake') }
|
68
68
|
let(:queue) { Queue.new }
|
@@ -72,13 +72,12 @@ describe ProcessHandler::CronProcess do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'notifies of exception' do
|
75
|
-
process.schedule('0.
|
75
|
+
process.schedule('0.3')
|
76
76
|
expect(exception_notifier).to receive(:notify_or_ignore)
|
77
77
|
Thread.new do
|
78
78
|
process.spawn(ExceptionService.new(queue))
|
79
79
|
end
|
80
80
|
queue.pop
|
81
|
-
sleep 0.1
|
82
81
|
end
|
83
82
|
|
84
83
|
end
|
@@ -154,15 +154,23 @@ describe ProcessHandler::PivotProcess do
|
|
154
154
|
end
|
155
155
|
|
156
156
|
context 'and its never fulfilled' do
|
157
|
+
|
158
|
+
let(:timeout) { 0.001 }
|
159
|
+
|
157
160
|
before do
|
158
161
|
allow(result).to receive(:fulfilled?) { false }
|
159
|
-
allow(result).to receive(:timeout) {
|
162
|
+
allow(result).to receive(:timeout) { timeout }
|
160
163
|
end
|
161
164
|
|
162
165
|
it 'responds with timeout error' do
|
163
166
|
expect(handler).to receive(:error).with(success: false, error: "Fulfillable response was not fulfilled")
|
164
167
|
subject
|
165
168
|
end
|
169
|
+
|
170
|
+
it 'logs the error' do
|
171
|
+
expect(logger).to receive(:error).with("Fullfillable response was not fulfilled in #{timeout} seconds", {})
|
172
|
+
subject
|
173
|
+
end
|
166
174
|
end
|
167
175
|
end
|
168
176
|
end
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Indrek Juhkam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake
|