fluent-plugin-newrelic 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fee9e5d8ce77d5a79877171c346a8205752889e547b3857bb02c53355b3f4ec8
4
- data.tar.gz: 7748b0e7317195d9457a8f9a4edc91b80b204e8fe4412f84c129f14910edd195
3
+ metadata.gz: 307e45eb9ebc697bbd30ca8241c2f2b0babb1a90e9606d05661a15ec31cebf65
4
+ data.tar.gz: cb641311b6dfb6c78e3854b59b8dace22d4aa32a82201587bcdfe1f99def043b
5
5
  SHA512:
6
- metadata.gz: 7a10534bb6459af4f099ff07d61fb731ed127a550de3a022eb524d7e74919656586f3b9d3cd59741c2f2d1ba4a466aeecb5fcee858c6b4988a0d3d3cc99df96d
7
- data.tar.gz: 88bbdf3a4b55d58281acb1b32b4b92cc66dae25daae42c48e9dbb0222ce4bdd21f8fb61ec8f2a857563a0883cedc2ab57a08efa9c2f6e1f2f65d97db89abd364
6
+ metadata.gz: 717bca5a780c9ba5b8c920850958f4cc6a70b23764d8858942044a8d7ce937ca165a546c54b925036ab976302986b49909c0109768020f3dc9fc7cade7a037dc
7
+ data.tar.gz: 147f2831feda1b24efadd0e9f07375f26d85ab6ccf7ce2c83956e1f903cccccad180d3a718c40f300c940f49293f55a991902a6b28756a9bb1325e1b560187ef
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  .DS_Store
11
11
  .ruby-version
12
+ .idea/
@@ -110,11 +110,22 @@ module Fluent
110
110
  end
111
111
 
112
112
  def sleep_duration(attempt)
113
- [@max_delay, (2 ** attempt) * @retry_seconds].min
113
+ if attempt == 0
114
+ return 0
115
+ end
116
+
117
+ [@max_delay, (2 ** (attempt - 1)) * @retry_seconds].min
118
+ end
119
+
120
+ def sleep_on_retry(attempt)
121
+ duration = sleep_duration(attempt)
122
+ if duration > 0
123
+ sleep duration
124
+ end
114
125
  end
115
126
 
116
127
  def attempt_send(payload, attempt)
117
- sleep sleep_duration(attempt)
128
+ sleep_on_retry(attempt)
118
129
  attempt_send(payload, attempt + 1) unless was_successful?(send(payload)) if should_retry?(attempt)
119
130
  end
120
131
 
@@ -1,3 +1,3 @@
1
1
  module NewrelicFluentdOutput
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-newrelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - New Relic Logging Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-26 00:00:00.000000000 Z
11
+ date: 2019-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd