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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1df6cf145c4f7cf522c6f701237af48b686e252260a0542644464c0249e1234
4
- data.tar.gz: dbf324c2d02b3f7b168a15c30d06bb29ef25fb5eb06376ffc21f8f21312a87e6
3
+ metadata.gz: 2f07fa22e48105ec0291a12d8bf9fb09c90234bd5152e193880151c56035f89e
4
+ data.tar.gz: d0ce5ba03ede93e3b4978836beb37ae29f6636ff349fcc55120a079ce92786e5
5
5
  SHA512:
6
- metadata.gz: 1db48d3fa53866c82e36afd95dd8df19b733f0d7a7d391efdefd89f931b82f36c29c4a8d64314e35b5051691b6f7de1bea8ab3ef8e17085990eb2d471bfef712
7
- data.tar.gz: f75f80961966e58b047a41ebe8a242b7feb65fef216be54e5f9edcbf45a027fdbe853b365f7bc816b4c42f83d76550ba5a29aac7da1d7a01a10441c2905ce175
6
+ metadata.gz: a32848fd471d491fafea1c78668a884367354c9c5abdd5e2b144c99487d07dceb3fcc0e26bc33d4c05af77a8d48893242db14ef2e0e266244d54546e24d18e21
7
+ data.tar.gz: 59e634480aa5b49822e9f137bd4f7e078dc654d9410d931809983d124f2406ea4158ee623ca523a19f887be4386ecc93985f08c862a3325fc4fce1198f72d57a
@@ -7,6 +7,8 @@ agent: bundler-plugin
7
7
  agent_version: '1.0'
8
8
  product: ''
9
9
  product_version: ''
10
+ retries:
11
+ interval:
10
12
  coordinates:
11
13
  artifact_id: ''
12
14
  version: ''
@@ -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
- connection.post(Configure.api_path, payload(gem_list, options))
70
- rescue Faraday::Error::ClientError => ex
71
- ex
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
@@ -1,4 +1,4 @@
1
1
  module WssAgent
2
- VERSION = '18.6.2'.freeze
2
+ VERSION = '18.10.2'.freeze
3
3
  NAME = 'wss_agent'.freeze
4
4
  end
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.6.2
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-06-24 00:00:00.000000000 Z
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.3
342
+ rubygems_version: 2.7.6
343
343
  signing_key:
344
344
  specification_version: 4
345
345
  summary: White Source agent.