easypost 4.1.0 → 4.1.1

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: c1b008c0a117ef6b7ad4082b45e0ca94b723e14601b24c8732da23166acb1996
4
- data.tar.gz: 52057de46c2642e4896c81a1d866e0b47fe4ec20fbad91ca5d0814a7c9fa6ea1
3
+ metadata.gz: 80b21caf35b36c26582451d01113e423da031f0a8dd4ab3e86bc02e40113f2ef
4
+ data.tar.gz: adc284c07d8e9f8650bbbbba486997b6c252d364f489982e9cc2b41af1a822a9
5
5
  SHA512:
6
- metadata.gz: 41f82883c0831354a2c517910a35b6fdb0a3335ec3e86fb7038ffd2660b56523819c2181f45b97814445fb62781a749009cc0a936a9011a80a93600817a1ecfc
7
- data.tar.gz: 7000cae174dd8b99bc5e6608a922d68692f1586afe370c2daa97ee854c0540766ada8cb84fa53c1d3ae389c23a1fbf813d046bf91519c0262bd5226565f6e535
6
+ metadata.gz: 7d771d5798aefff39d456db171bf206db492c90b0bdbb8bbf8471d7112de25ec5ce433c7f8c73f90f6c14bc9b55d0af5016677ba3a70c5d053e5fdeb496da214
7
+ data.tar.gz: 74ed0c9883907b041c05baf185644be0db456c1350fb08db63071b5188b5391260d1be6d1f4851e430d587c79de6fd32ec3653c28f7699b630680bdcb63e1c44
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v4.1.1 (2022-03-14)
4
+
5
+ - Fixes a bug that prematurely closed connections when using multithreading by wrapping requests in a mutex (closes #148)
6
+
3
7
  ## v4.1.0 (2022-03-09)
4
8
 
5
9
  - Adds support for custom client connections (#142)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.0
1
+ 4.1.1
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  EasyPost::Connection = Struct.new(:uri, :config, keyword_init: true) do
4
- attr_reader :connection
4
+ attr_reader :connection, :mutex
5
5
 
6
6
  def initialize(uri:, config:)
7
7
  super
8
8
 
9
+ @mutex = Mutex.new
9
10
  @connection =
10
11
  if config[:proxy]
11
12
  proxy_uri = URI(config[:proxy])
@@ -56,7 +57,7 @@ EasyPost::Connection = Struct.new(:uri, :config, keyword_init: true) do
56
57
  EasyPost.default_headers.each_pair { |h, v| request[h] = v }
57
58
  request['Authorization'] = EasyPost.authorization(api_key) if api_key
58
59
 
59
- response = connection.request(request)
60
+ response = mutex.synchronize { connection.request(request) }
60
61
 
61
62
  EasyPost.parse_response(
62
63
  status: response.code.to_i,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - EasyPost Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry