wss_agent 18.6.2 → 18.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/default.yml +2 -0
- data/lib/wss_agent/client.rb +20 -3
- data/lib/wss_agent/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f07fa22e48105ec0291a12d8bf9fb09c90234bd5152e193880151c56035f89e
|
4
|
+
data.tar.gz: d0ce5ba03ede93e3b4978836beb37ae29f6636ff349fcc55120a079ce92786e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a32848fd471d491fafea1c78668a884367354c9c5abdd5e2b144c99487d07dceb3fcc0e26bc33d4c05af77a8d48893242db14ef2e0e266244d54546e24d18e21
|
7
|
+
data.tar.gz: 59e634480aa5b49822e9f137bd4f7e078dc654d9410d931809983d124f2406ea4158ee623ca523a19f887be4386ecc93985f08c862a3325fc4fce1198f72d57a
|
data/lib/config/default.yml
CHANGED
data/lib/wss_agent/client.rb
CHANGED
@@ -10,6 +10,9 @@ module WssAgent
|
|
10
10
|
|
11
11
|
UPDATE_TYPE = 'UPDATE'.freeze
|
12
12
|
REQUEST_TIMEOUT = 120
|
13
|
+
RECONNECT_RETRIES = 1
|
14
|
+
RECONNECT_INTERVAL = 3
|
15
|
+
|
13
16
|
|
14
17
|
def initialize
|
15
18
|
@connection ||= Faraday.new(connection_options) do |h|
|
@@ -66,9 +69,23 @@ module WssAgent
|
|
66
69
|
def request(gem_list, options = {})
|
67
70
|
WssAgent.logger.debug "request params: #{payload(gem_list, options)}"
|
68
71
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
retries = Configure['retries'] ? Configure['retries'] : RECONNECT_RETRIES
|
73
|
+
interval = Configure['interval']? Configure['interval'] : RECONNECT_INTERVAL
|
74
|
+
|
75
|
+
while retries > 0
|
76
|
+
begin
|
77
|
+
return connection.post(Configure.api_path, payload(gem_list, options))
|
78
|
+
rescue Faraday::Error::ClientError => ex
|
79
|
+
retries = retries - 1
|
80
|
+
WssAgent.logger.error "Failed to send request to WhiteSource server: #{ex}"
|
81
|
+
if retries > 0
|
82
|
+
WssAgent.logger.error "Trying to connect to WhiteSource server again. sleeping #{interval} seconds..."
|
83
|
+
sleep(interval)
|
84
|
+
else
|
85
|
+
return ex
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
72
89
|
end
|
73
90
|
|
74
91
|
private
|
data/lib/wss_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wss_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 18.
|
4
|
+
version: 18.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
339
|
version: '0'
|
340
340
|
requirements: []
|
341
341
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.7.
|
342
|
+
rubygems_version: 2.7.6
|
343
343
|
signing_key:
|
344
344
|
specification_version: 4
|
345
345
|
summary: White Source agent.
|