Retrying failed connections using the Node.js mssql module

Code comment that explains how failed connections are retried when connecting to Cloud SQL for SQL Server using the Node.js mssql module.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample

Node.js

To authenticate to Cloud SQL for SQL Server, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

// The node-mssql module uses a built-in retry strategy which does not implement backoff.
// 'createRetryIntervalMillis' is the number of milliseconds to wait in between retries.
config.pool.createRetryIntervalMillis = 200;

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.