3.12.0 (2021-07-06)
Features Added
- With the dropping of support for Node.js versions that are no longer in LTS, the dependency on
@types/node
has been updated to version 12. Read our support policy for more details. - Added background refresher for endpoints, and new
ConnectionPolicy
options. Refreshing defaults to true, and the default refresh rate is every 5 minutes.
const client = new CosmosClient({
endpoint,
key: masterKey,
connectionPolicy: {
...defaultConnectionPolicy,
endpointRefreshRateInMs: 700,
enableBackgroundEndpointRefreshing: true
}
})
- Added
client.dispose()
for closing the endpoint refresher verbosely. Necessary when destroying the CosmosClient inside existing processes like an express web server, or when you want to destroy the client and create a new one in the same process.
const client = new CosmosClient()
client.dispose() // cancels background endpoint refreshing