-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for a lazy refresh #772
Conversation
When creating a Dialer with the WithLazyRefresh option, the connection info and ephemeral certificate will be refreshed only when the cache certificate has expired. No background goroutines run with this option, making it ideal for use in Cloud Run and other serverless environments where the CPU may be throttled.
@@ -42,6 +42,7 @@ type dialerConfig struct { | |||
refreshTimeout time.Duration | |||
useIAMAuthN bool | |||
logger debug.Logger | |||
lazyRefresh bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want this as lazyRefresh
or refreshType
? do we see a future where we add another option for refreshes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed elsewhere, we're keeping this field unexported so we can adapt it in the future if needed.
When creating a Dialer with the WithLazyRefresh option, the connection info and ephemeral certificate will be refreshed only when the cache certificate has expired. No background goroutines run with this option, making it ideal for use in Cloud Run and other serverless environments where the CPU may be throttled. This is a port of GoogleCloudPlatform/cloud-sql-go-connector#772 Fixes #549
When creating a Dialer with the WithLazyRefresh option, the connection info and ephemeral certificate will be refreshed only when the cache certificate has expired. No background goroutines run with this option, making it ideal for use in Cloud Run and other serverless environments where the CPU may be throttled. This is a port of GoogleCloudPlatform/cloud-sql-go-connector#772 Fixes #549
When creating a Dialer with the WithLazyRefresh option, the connection info and ephemeral certificate will be refreshed only when the cache certificate has expired. No background goroutines run with this option, making it ideal for use in Cloud Run and other serverless environments where the CPU may be throttled.
Fixes #770