condux 0.2.0 → 0.2.1

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: 985adaf0c8807f4c03e4c83b2d4969bf37d505f7abba46d06cbb6de95bb83ff5
4
- data.tar.gz: 466b2a9ddcdc2056a6bf38db174fabad21c3a920f6e3bea090c1a4b0bda493e2
3
+ metadata.gz: 177733db27d5f93e4a4eb80a165615ccb2ed601e643227199fe3012173aa174f
4
+ data.tar.gz: b6f67d3e221eace89e83c0ea9cd39a6d4c7eb7dfa28ffbbf93175bb9249b150d
5
5
  SHA512:
6
- metadata.gz: a638998e2b15a3f7c90c1c8c632ee8c400892ad848aeba80a4361eec7d178e2b5add4a00057c393042dded2b32d5244f2ae55958efad1c5c6aab7d3eb9256081
7
- data.tar.gz: 6513420fa59559a2e5cee3237d6c91ed254342d45110348a18a15b4feab59924214c87c21823e84551803a73f85c752c0c000706cd1e0f7e33ecf4cedcff1ef4
6
+ metadata.gz: 7ce83a8101528086e83fc17cdfbf82c3fda336a1a32c5c0a740c39bee94cf40000a18fc90fd057f4862f82248d31a0988b4ee60f415695711957e9e3bbc353ad
7
+ data.tar.gz: cbe10c8764cbb08114fec8fe5411618e018efccc6c12f57bbcea31b6de3a9ea15ab62a9063781d01dc6a6d7e7c4e0385cd672a2acb1aad6f7daa585e880f443f
@@ -59,8 +59,12 @@ module Condux
59
59
  status == 429 || status >= 500
60
60
  end
61
61
 
62
- # Honor Retry-After (seconds) on a 429; otherwise capped exponential backoff. Returns seconds.
62
+ # Honor Retry-After (seconds) on a 429, else exponential backoff. Both paths are capped at
63
+ # MAX_BACKOFF_MS, at ONE return so a later branch cannot route past it: the SDK holds the caller's
64
+ # thread while it waits, so bounding that wait is its own obligation and not the relay's to set.
65
+ # Returns seconds.
63
66
  def backoff_seconds(attempt, status, headers)
67
+ wanted_ms = BASE_BACKOFF_MS * (2**attempt)
64
68
  if status == 429
65
69
  retry_after = header(headers, "retry-after")
66
70
  if retry_after && !retry_after.strip.empty?
@@ -69,10 +73,10 @@ module Condux
69
73
  rescue ArgumentError, TypeError
70
74
  nil
71
75
  end
72
- return [seconds, 0.0].max if seconds
76
+ wanted_ms = [seconds, 0.0].max * 1000.0 if seconds
73
77
  end
74
78
  end
75
- [BASE_BACKOFF_MS * (2**attempt), MAX_BACKOFF_MS].min / 1000.0
79
+ [wanted_ms, MAX_BACKOFF_MS].min / 1000.0
76
80
  end
77
81
 
78
82
  def header(headers, name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: condux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Condux
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-06 00:00:00.000000000 Z
11
+ date: 2026-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'The Condux SDK for Ruby: report errors to a Condux relay with a resilient,
14
14
  never-raising transport. Zero runtime dependencies (standard library only).'