File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
src/AWS.Deploy.CLI/ServerMode Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -699,6 +699,15 @@ private IServiceProvider CreateSessionServiceProvider(SessionState state)
699699 services . AddSingleton < IAWSResourceQueryer > ( state . AWSResourceQueryService ) ;
700700 }
701701
702+ if ( state . SystemCapabilityEvaluator == null )
703+ {
704+ services . AddSingleton < ISystemCapabilityEvaluator , SystemCapabilityEvaluator > ( ) ;
705+ }
706+ else
707+ {
708+ services . AddSingleton < ISystemCapabilityEvaluator > ( state . SystemCapabilityEvaluator ) ;
709+ }
710+
702711 services . AddCustomServices ( ) ;
703712 var serviceProvider = services . BuildServiceProvider ( ) ;
704713
@@ -710,9 +719,11 @@ private IServiceProvider CreateSessionServiceProvider(SessionState state)
710719 awsOptions . Region = RegionEndpoint . GetBySystemName ( state . AWSRegion ) ;
711720 } ) ;
712721
713- // Cache the SessionAWSResourceQuery with the session state so it can be reused in future
714- // ServerMode API calls with the same session id.
722+ // Cache the SessionAWSResourceQuery and SystemCapabilityEvaluator with the session state
723+ // so they can be reused in future ServerMode API calls with the same session id. This avoids reloading
724+ // existing resources from AWS and running the Docker/Node checks when they're not expected to change.
715725 state . AWSResourceQueryService = serviceProvider . GetRequiredService < IAWSResourceQueryer > ( ) as SessionAWSResourceQuery ;
726+ state . SystemCapabilityEvaluator = serviceProvider . GetRequiredService < ISystemCapabilityEvaluator > ( ) as SystemCapabilityEvaluator ;
716727
717728 return serviceProvider ;
718729 }
Original file line number Diff line number Diff line change 55using System . Threading . Tasks ;
66using AWS . Deploy . CLI . ServerMode . Services ;
77using AWS . Deploy . Common ;
8+ using AWS . Deploy . Orchestration ;
89
910namespace AWS . Deploy . CLI . ServerMode
1011{
@@ -30,6 +31,8 @@ public class SessionState
3031
3132 public SessionAWSResourceQuery ? AWSResourceQueryService { get ; set ; }
3233
34+ public SystemCapabilityEvaluator ? SystemCapabilityEvaluator { get ; set ; }
35+
3336 public Task ? DeploymentTask { get ; set ; }
3437
3538 public SessionState (
You can’t perform that action at this time.
0 commit comments