percy-common 2.0.0 → 2.1.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
  SHA1:
3
- metadata.gz: ff0436bf3b67e3b1ba96ceef1acb452769389899
4
- data.tar.gz: 9f89386fbf9f6e0b64b6246f09700d08af9f3e17
3
+ metadata.gz: e83edb8522d97d14d009c557cc1cf30e9dfb8e14
4
+ data.tar.gz: ed41e132239c852c14c9db2387f075cf200ec694
5
5
  SHA512:
6
- metadata.gz: 07a215cba17815974cf1ef9d9b8e577a5739e7d47c8d3cd652bc1563cbc82dfb17cecbe79ffcd01d6766f6ba199de7231157d8f35b320e75fc075f0aa65ee91d
7
- data.tar.gz: 6030828cb677b3ba831d8626a5045f859d95c537b72cee5531c684eba0679e388d3a9231af649098112829c8f4edf64d173b5a7361a4ac6d020a4a3669d84752
6
+ metadata.gz: 20290f9419c06622b11192f2a40de6265593e868d2ee70cf9d9cd5a4443fb9c38db76246f75ca95438e4a405f399c3bf4c0267ddd3daca2676990d87ece77905
7
+ data.tar.gz: ba60224166e45dbd34f6919d27b2bff99c4d660d78dab56002240a358678d43fe02f30b22ed9fa8107eb1ca04f2fb796f0ce9c48b9d718d9c6193cba9fa1ff74
data/.travis.yml CHANGED
@@ -5,6 +5,7 @@ rvm:
5
5
  - 2.4
6
6
  - ruby-head
7
7
  before_install:
8
+ - gem update --system
8
9
  - gem update bundler
9
10
  script:
10
11
  - bundle exec rubocop -D
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Common
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '2.1.0'.freeze
4
4
  end
5
5
  end
data/lib/percy/stats.rb CHANGED
@@ -8,7 +8,18 @@ module Percy
8
8
  port ||= Integer(ENV.fetch('DATADOG_AGENT_PORT', ::Datadog::Statsd::DEFAULT_PORT))
9
9
  opts[:tags] ||= []
10
10
  opts[:tags] << "env:#{ENV['PERCY_ENV'] || 'development'}"
11
- super(host, port, opts, max_buffer_size)
11
+ retry_delay = opts[:retry_delay] || 1
12
+ retry_count = opts[:retry_count] || 3
13
+ retries = 0
14
+
15
+ begin
16
+ super(host, port, opts, max_buffer_size)
17
+ rescue SocketError
18
+ host = 'localhost' if retries >= retry_count
19
+ sleep retry_delay
20
+ retries += 1
21
+ retry
22
+ end
12
23
  end
13
24
 
14
25
  # Equivalent to stats.time, but without wrapping in blocks and dealing with var scoping issues.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dogstatsd-ruby