Skip to content

Commit

Permalink
fix: hanging resources in clear
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-bq committed Jan 30, 2025
1 parent aa8017f commit 8d30bbf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ export class MonitoringRdsHostListProvider extends RdsHostListProvider {

async clearAll(): Promise<void> {
RdsHostListProvider.clearAll();
await MonitoringRdsHostListProvider.monitors.clear();
// TODO: refactor when sliding-expiration-cache refactoring is merged.
for (const [key, monitor] of MonitoringRdsHostListProvider.monitors.entries) {
if (monitor !== undefined) {
await monitor.item.close();
}
}
MonitoringRdsHostListProvider.monitors.clear();
}

async queryForTopology(targetClient: ClientWrapper, dialect: DatabaseDialect): Promise<HostInfo[]> {
Expand Down

0 comments on commit 8d30bbf

Please sign in to comment.