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: 7f5e8af968e63c3dcf63da7c363cac6202e1cfbf
4
- data.tar.gz: 2ac6f1f121b0061955439fb2d895e9f980e82e8d
3
+ metadata.gz: 42e47422baa38b9c91c4bbaff699373e903c6f01
4
+ data.tar.gz: 5378e9443a93f92a57cb83ea6c69197b6ec9ae6a
5
5
  SHA512:
6
- metadata.gz: 0ee3be4e336be22d5e66fd13b1e803cad36ab5e219873b01b7a5a30e2a8513dcf8b493b6beee90cc602a4cc09a9452d65cbe8c30cd558782ec08560e55c9c437
7
- data.tar.gz: 27fced5c1fc513bccccce73bff82e27327964b31bbeba8449f78abd929bc19418896ef409db58323dab8c185f06829d4bae6ba60fe294d8cc13edde3d4d2894f
6
+ metadata.gz: a9e25775c634f4bd5a41c3dde5ede86888c1222e396ad871f74f6999c5ef010cf1accd6a209c053658aa1dffe953325a04bb7aa6e17174fe87ba8ca1990f057b
7
+ data.tar.gz: 401159f363f22948e273b396a3795139cf5879a6e27d5225301a06876cd668c2fb638cef21eb660dc6990a30ef9366939e6b785ae05b7f9eb56f9df4c9072496
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gem 'rufus-scheduler'
5
5
  gem 'logasm'
6
6
 
7
7
  group :test do
8
- gem 'rspec', '~> 3.1'
8
+ gem 'rspec', '~> 3.1.0'
9
9
  gem 'pry'
10
10
  end
11
11
 
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Salemove
2
2
  module ProcessHandler
3
- VERSION = '0.2.8'
3
+ VERSION = '0.2.9'
4
4
  end
5
5
  end
@@ -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.1} }}
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.2')
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) { 0.001 }
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.8
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-18 00:00:00.000000000 Z
11
+ date: 2016-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake