googleapis / langchain-google-alloydb-pg-python

Apache License 2.0
9 stars 9 forks source link

fix: use lazy refresh for AlloyDB Connector #162

Closed jackwotherspoon closed 6 days ago

jackwotherspoon commented 6 days ago

The AlloyDB Python Connector just released a new version v1.2.0 that supports setting the refresh_strategy argument of the connector.

Setting the refresh strategy to lazy refresh is recommended for serverless environments. As the default refresh strategy is to have background refreshes occur to get the instance metadata and a fresh certificate to use for the SSL/TLS connection.

However, these background refreshes can be throttled when serverless environments scale to zero (Cloud Functions, Cloud Run etc.).

This PR will fix the ambiguous errors that are a result of the CPU being throttled for the AlloyDB Connector.

Fixes #160