journaled 2.3.1 → 2.4.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: 2e0ac797fddc64eabddd16d1568cd48575f6b24d4260806d728d646621d4e745
4
- data.tar.gz: 60b89f10db4c2c3d1a0d2caa5b81dcaeb545de619f46ba083db836bfac249918
3
+ metadata.gz: a57088ffa5913d3e80f1d6d978bfe3f0a4ff090bd78f20f3fcbed1c32b84bdbc
4
+ data.tar.gz: 75c470723ae03dd2695300c0a8a2aaf0d05202fac8fdb5157efd248214a7eb6d
5
5
  SHA512:
6
- metadata.gz: ebb94b8d76cd1505f12478a8cc06ae6a7ad410b7c20ae8192d73254a4464dbd9bd927f5cd7dcd73a29518c28cbee8eef7acfdc79635b5a4c6444c5e982c92b7a
7
- data.tar.gz: 83040c8030484021fecd580a3e50c553fedbefb35306922ecc317a8ea3417bb115a353137d743c805a8ffad934da27f1cc0c36c0645f86612e23d17d5c0d599f
6
+ metadata.gz: ffcbd7201f572423fa304c440d18b2993e7a97050b5ac7b1be68143da64a8c7caaa430aa3ef64d8a99940380b67361e50ef55cb9ce01cecb9dd017f977e08934
7
+ data.tar.gz: a6c33d7c56b1fbd9558d219617a12dbfa0b704dac7b9ca3171cd2387477a3b00a6fe6dac592ed6a8cc4a4f6de2cbb806ff49d670134131a6e2eddfe5d64be0d7
data/README.md CHANGED
@@ -88,6 +88,18 @@ Journaling provides a number of different configuation options that can be set i
88
88
  This can be used to configure what `priority` the Delayed Jobs are enqueued with. This will be applied to all the Journaled::Devivery jobs that are created by this application.
89
89
  Ex: `Journaled.job_priority = 14`
90
90
 
91
+ #### `Journaled.http_idle_timeout` (default: 1 second)
92
+
93
+ The number of seconds a persistent connection is allowed to sit idle before it should no longer be used.
94
+
95
+ #### `Journaled.http_open_timeout` (default: 15 seconds)
96
+
97
+ The number of seconds before the :http_handler should timeout while trying to open a new HTTP session.
98
+
99
+ #### `Journaled.http_read_timeout` (default: 60 seconds)
100
+
101
+ The number of seconds before the :http_handler should timeout while waiting for a HTTP response.
102
+
91
103
  #### DJ `enqueue` options
92
104
 
93
105
  Both model-level directives accept additional options to be passed into DelayedJob's `enqueue` method:
@@ -1,4 +1,4 @@
1
- class Journaled::Delivery
1
+ class Journaled::Delivery # rubocop:disable Betterment/ActiveJobPerformable
2
2
  DEFAULT_REGION = 'us-east-1'.freeze
3
3
 
4
4
  def initialize(serialized_event:, partition_key:, app_name:)
@@ -26,6 +26,9 @@ class Journaled::Delivery
26
26
  {
27
27
  region: ENV.fetch('AWS_DEFAULT_REGION', DEFAULT_REGION),
28
28
  retry_limit: 0,
29
+ http_idle_timeout: Journaled.http_idle_timeout,
30
+ http_open_timeout: Journaled.http_open_timeout,
31
+ http_read_timeout: Journaled.http_read_timeout,
29
32
  }.merge(credentials)
30
33
  end
31
34
 
@@ -9,6 +9,9 @@ require 'journaled/enqueue'
9
9
  module Journaled
10
10
  mattr_accessor :default_app_name
11
11
  mattr_accessor(:job_priority) { 20 }
12
+ mattr_accessor(:http_idle_timeout) { 5 }
13
+ mattr_accessor(:http_open_timeout) { 15 }
14
+ mattr_accessor(:http_read_timeout) { 60 }
12
15
 
13
16
  def development_or_test?
14
17
  %w(development test).include?(Rails.env)
@@ -1,3 +1,3 @@
1
1
  module Journaled
2
- VERSION = "2.3.1".freeze
2
+ VERSION = "2.4.0".freeze
3
3
  end
@@ -185,5 +185,38 @@ RSpec.describe Journaled::Delivery do
185
185
  expect(subject.kinesis_client_config).to include(access_key_id: 'key_id', secret_access_key: 'secret')
186
186
  end
187
187
  end
188
+
189
+ it "will set http_idle_timeout by default" do
190
+ expect(subject.kinesis_client_config).to include(http_idle_timeout: 5)
191
+ end
192
+
193
+ it "will set http_open_timeout by default" do
194
+ expect(subject.kinesis_client_config).to include(http_open_timeout: 15)
195
+ end
196
+
197
+ it "will set http_read_timeout by default" do
198
+ expect(subject.kinesis_client_config).to include(http_read_timeout: 60)
199
+ end
200
+
201
+ context "when Journaled.http_idle_timeout is specified" do
202
+ it "will set http_idle_timeout by specified value" do
203
+ allow(Journaled).to receive(:http_idle_timeout).and_return(2)
204
+ expect(subject.kinesis_client_config).to include(http_idle_timeout: 2)
205
+ end
206
+ end
207
+
208
+ context "when Journaled.http_open_timeout is specified" do
209
+ it "will set http_open_timeout by specified value" do
210
+ allow(Journaled).to receive(:http_open_timeout).and_return(2)
211
+ expect(subject.kinesis_client_config).to include(http_open_timeout: 2)
212
+ end
213
+ end
214
+
215
+ context "when Journaled.http_read_timeout is specified" do
216
+ it "will set http_read_timeout by specified value" do
217
+ allow(Journaled).to receive(:http_read_timeout).and_return(2)
218
+ expect(subject.kinesis_client_config).to include(http_read_timeout: 2)
219
+ end
220
+ end
188
221
  end
189
222
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: journaled
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Lipson
8
8
  - Corey Alexander
9
9
  - Cyrus Eslami
10
10
  - John Mileham
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-04-28 00:00:00.000000000 Z
14
+ date: 2020-12-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: aws-sdk-kinesis
@@ -341,7 +341,7 @@ homepage: http://github.com/Betterment/journaled
341
341
  licenses:
342
342
  - MIT
343
343
  metadata: {}
344
- post_install_message:
344
+ post_install_message:
345
345
  rdoc_options: []
346
346
  require_paths:
347
347
  - lib
@@ -356,8 +356,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
356
356
  - !ruby/object:Gem::Version
357
357
  version: '0'
358
358
  requirements: []
359
- rubygems_version: 3.1.2
360
- signing_key:
359
+ rubygems_version: 3.0.1
360
+ signing_key:
361
361
  specification_version: 4
362
362
  summary: Journaling for Betterment apps.
363
363
  test_files: