Skip to content

Commit

Permalink
remove assembly caching from stage.ts synth() function
Browse files Browse the repository at this point in the history
Signed-off-by: Sumu <[email protected]>
  • Loading branch information
sumupitchayan committed Oct 23, 2024
1 parent c4e1795 commit fd13c07
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/aws-cdk-lib/core/lib/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ export class Stage extends Construct {
*/
public readonly parentStage?: Stage;

/**
* The cached assembly if it was already built
*/
private assembly?: cxapi.CloudAssembly;

/**
* Validation plugins to run during synthesis. If any plugin reports any violation,
* synthesis will be interrupted and the report displayed to the user.
Expand Down Expand Up @@ -210,14 +205,10 @@ export class Stage extends Construct {
* calls will return the same assembly.
*/
public synth(options: StageSynthesisOptions = { }): cxapi.CloudAssembly {
if (!this.assembly || options.force) {
this.assembly = synthesize(this, {
skipValidation: options.skipValidation,
validateOnSynthesis: options.validateOnSynthesis,
});
}

return this.assembly;
return synthesize(this, {
skipValidation: options.skipValidation,
validateOnSynthesis: options.validateOnSynthesis,
});
}

private createBuilder(outdir?: string) {
Expand Down

0 comments on commit fd13c07

Please sign in to comment.