Skip to content

Commit

Permalink
fix: Use lightweight Spanner call to address memory leak (cloudspanne…
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybell authored Aug 29, 2024
1 parent 07b9ca4 commit 5e85ecb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/poller/poller-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ async function getSpannerMetadata(projectId, spannerInstanceId, units) {

try {
const spannerInstance = spanner.instance(spannerInstanceId);

const databaseAdminClient = spanner.getDatabaseAdminClient();
const results = await Promise.all([
spannerInstance.getDatabases(),
databaseAdminClient.listDatabases({
parent: databaseAdminClient.instancePath(projectId, spannerInstanceId),
}),
spannerInstance.getMetadata(),
]);
const numDatabases = results[0][0].length;
Expand Down

0 comments on commit 5e85ecb

Please sign in to comment.