Skip to content

Commit 468b838

Browse files
authored
fix(toolkit-lib): "refactor" never releases reader lock or cleans up temp dir (#700)
The refactor operation was not using `await using` on the assembly that it got from `assemblyFromSource`, causing it to never be cleaned up. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent fb0e690 commit 468b838

File tree

1 file changed

+2
-2
lines changed
  • packages/@aws-cdk/toolkit-lib/lib/toolkit

1 file changed

+2
-2
lines changed

packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,8 @@ export class Toolkit extends CloudAssemblySourceBuilder {
10621062
this.requireUnstableFeature('refactor');
10631063

10641064
const ioHelper = asIoHelper(this.ioHost, 'refactor');
1065-
const assembly = await assemblyFromSource(ioHelper, cx);
1066-
return this._refactor(assembly, ioHelper, options);
1065+
await using assembly = await assemblyFromSource(ioHelper, cx);
1066+
return await this._refactor(assembly, ioHelper, options);
10671067
}
10681068

10691069
private async _refactor(assembly: StackAssembly, ioHelper: IoHelper, options: RefactorOptions = {}): Promise<void> {

0 commit comments

Comments
 (0)