cloud-sql-python-connector 1.4.0__py2.py3-none-any.whl → 1.4.1__py2.py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloud-sql-python-connector
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.
5
5
  Home-page: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
6
6
  Author: Google LLC
@@ -1,10 +1,10 @@
1
- cloud_sql_python_connector-1.4.0-py3.9-nspkg.pth,sha256=b0D5dZk3RUzK54tZ9iZDvLm7u8ltc5EzYrGCmhsuoNw,1698
1
+ cloud_sql_python_connector-1.4.1-py3.9-nspkg.pth,sha256=b0D5dZk3RUzK54tZ9iZDvLm7u8ltc5EzYrGCmhsuoNw,1698
2
2
  google/cloud/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  google/cloud/sql/connector/__init__.py,sha256=0PbPT7guIVFjTKy1mIkMge_BdiZDWooWf-Vll08nuIQ,876
4
4
  google/cloud/sql/connector/asyncpg.py,sha256=c4lAlvEgGf_eBq0G8MVNPRAJQQvo6DcwybiXDW36qkU,1838
5
- google/cloud/sql/connector/connector.py,sha256=I0WjRryj_RfRX2LNouiRiOigBCHPdQaMLZAHZppWJQw,14195
5
+ google/cloud/sql/connector/connector.py,sha256=TciqbF7R92eJKXHqhWZvPBRsff7oYF-3yeHCttfTO3w,14201
6
6
  google/cloud/sql/connector/exceptions.py,sha256=99sY_6UVuSeSg1jFusXOpPWEsbzDwk-LLo4WZkcsL2A,1649
7
- google/cloud/sql/connector/instance.py,sha256=a3jBfYvzX0kxWTTSs150SewLMXY1DebyOfTNzER8f7s,17570
7
+ google/cloud/sql/connector/instance.py,sha256=fgbxXQ6qtJlofhgotxhu4T87ptJls99i_hT2NtsnuGs,17649
8
8
  google/cloud/sql/connector/pg8000.py,sha256=EZuO7XgCkG_Y79NQlh3Vv8Ff2w85BFJyFVO237hx1GM,1814
9
9
  google/cloud/sql/connector/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  google/cloud/sql/connector/pymysql.py,sha256=wldUgwDPlPa8Nj5F3JaipuP8hJyvzlgOAJbRnOoaB1U,2105
@@ -12,10 +12,10 @@ google/cloud/sql/connector/pytds.py,sha256=vKJoE7E2P0GrhZojg8bGZkqCMLc8dgKAcXE4e
12
12
  google/cloud/sql/connector/rate_limiter.py,sha256=Ci3f-94090bj0cWJUu-vGZFc32IWRCyi8TIgChsQvxY,2954
13
13
  google/cloud/sql/connector/refresh_utils.py,sha256=m0kPpRDEQgrq5PBLhdeGNSiOWWY8oBA6d0pOoTznKII,9565
14
14
  google/cloud/sql/connector/utils.py,sha256=Y5I0kIAiT-Fb1xa50EKIJmyPBccd3lWCZ2OT4SbdxQI,4371
15
- google/cloud/sql/connector/version.py,sha256=2N78hpg0r-y_Jy9ZmmLCZ2gS6bPN4zf7B4rd-IbHdpw,597
16
- cloud_sql_python_connector-1.4.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
17
- cloud_sql_python_connector-1.4.0.dist-info/METADATA,sha256=JxlVJiLBOBcx6mEYpcaMkHuBR5ESB09SJXRTdvNzkeI,24144
18
- cloud_sql_python_connector-1.4.0.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
19
- cloud_sql_python_connector-1.4.0.dist-info/namespace_packages.txt,sha256=v8IaYqRE2a0onAGJIpZeFkkH83wXSWZRR9eOyfMwoTc,20
20
- cloud_sql_python_connector-1.4.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
21
- cloud_sql_python_connector-1.4.0.dist-info/RECORD,,
15
+ google/cloud/sql/connector/version.py,sha256=eEdgQtHsN2o2YsShYyjrQLZSoyk4nSu7NHvrSWUhnPc,597
16
+ cloud_sql_python_connector-1.4.1.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
17
+ cloud_sql_python_connector-1.4.1.dist-info/METADATA,sha256=jDNJl8YGthz1pqtRli4HpfJwrTp8x4LeIPfg1wuhlG4,24144
18
+ cloud_sql_python_connector-1.4.1.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
19
+ cloud_sql_python_connector-1.4.1.dist-info/namespace_packages.txt,sha256=v8IaYqRE2a0onAGJIpZeFkkH83wXSWZRR9eOyfMwoTc,20
20
+ cloud_sql_python_connector-1.4.1.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
21
+ cloud_sql_python_connector-1.4.1.dist-info/RECORD,,
@@ -280,7 +280,7 @@ class Connector:
280
280
 
281
281
  except Exception:
282
282
  # with any exception, we attempt a force refresh, then throw the error
283
- instance.force_refresh()
283
+ await instance.force_refresh()
284
284
  raise
285
285
 
286
286
  def __enter__(self) -> Any:
@@ -255,7 +255,7 @@ class Instance:
255
255
  self._current = self._schedule_refresh(0)
256
256
  self._next = self._current
257
257
 
258
- def force_refresh(self) -> None:
258
+ async def force_refresh(self) -> None:
259
259
  """
260
260
  Forces a new refresh attempt immediately to be used for future connection attempts.
261
261
  """
@@ -263,8 +263,9 @@ class Instance:
263
263
  if not self._refresh_in_progress.is_set():
264
264
  self._next.cancel()
265
265
  self._next = self._schedule_refresh(0)
266
- # block all sequential connection attempts on the next refresh result
267
- self._current = self._next
266
+ # block all sequential connection attempts on the next refresh result if current is invalid
267
+ if not await _is_valid(self._current):
268
+ self._current = self._next
268
269
 
269
270
  async def _perform_refresh(self) -> InstanceMetadata:
270
271
  """Retrieves instance metadata and ephemeral certificate from the
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.4.0"
15
+ __version__ = "1.4.1"