Skip to content

Commit 18c051b

Browse files
committed
Lets us pass in timeout thresholds in config
1 parent e4864f4 commit 18c051b

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/asset_host/asset.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def connection
112112
:params => { auth_token: config.token },
113113
:ssl => {verify: false},
114114
:request => {
115-
:open_timeout => 1,
116-
:timeout => 2
115+
:open_timeout => config.open_timeout || 1,
116+
:timeout => config.timeout || 2
117117
}
118118
) do |conn|
119119
conn.use FaradayMiddleware::FollowRedirects

lib/asset_host_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
module AssetHostClient
66
class << self
7-
mattr_accessor :fallback_root, :server, :prefix, :token, :raise_on_errors, :protocol
7+
mattr_accessor :fallback_root, :server, :prefix, :token, :raise_on_errors,
8+
:protocol, :open_timeout, :timeout
89

910
# set some defaults
1011
self.prefix = "/api"

lib/asset_host_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module AssetHostClient
2-
VERSION = "2.1.6"
2+
VERSION = "2.1.7"
33
end

0 commit comments

Comments
 (0)