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)
699
699
services . AddSingleton < IAWSResourceQueryer > ( state . AWSResourceQueryService ) ;
700
700
}
701
701
702
+ if ( state . SystemCapabilityEvaluator == null )
703
+ {
704
+ services . AddSingleton < ISystemCapabilityEvaluator , SystemCapabilityEvaluator > ( ) ;
705
+ }
706
+ else
707
+ {
708
+ services . AddSingleton < ISystemCapabilityEvaluator > ( state . SystemCapabilityEvaluator ) ;
709
+ }
710
+
702
711
services . AddCustomServices ( ) ;
703
712
var serviceProvider = services . BuildServiceProvider ( ) ;
704
713
@@ -710,9 +719,11 @@ private IServiceProvider CreateSessionServiceProvider(SessionState state)
710
719
awsOptions . Region = RegionEndpoint . GetBySystemName ( state . AWSRegion ) ;
711
720
} ) ;
712
721
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.
715
725
state . AWSResourceQueryService = serviceProvider . GetRequiredService < IAWSResourceQueryer > ( ) as SessionAWSResourceQuery ;
726
+ state . SystemCapabilityEvaluator = serviceProvider . GetRequiredService < ISystemCapabilityEvaluator > ( ) as SystemCapabilityEvaluator ;
716
727
717
728
return serviceProvider ;
718
729
}
Original file line number Diff line number Diff line change 5
5
using System . Threading . Tasks ;
6
6
using AWS . Deploy . CLI . ServerMode . Services ;
7
7
using AWS . Deploy . Common ;
8
+ using AWS . Deploy . Orchestration ;
8
9
9
10
namespace AWS . Deploy . CLI . ServerMode
10
11
{
@@ -30,6 +31,8 @@ public class SessionState
30
31
31
32
public SessionAWSResourceQuery ? AWSResourceQueryService { get ; set ; }
32
33
34
+ public SystemCapabilityEvaluator ? SystemCapabilityEvaluator { get ; set ; }
35
+
33
36
public Task ? DeploymentTask { get ; set ; }
34
37
35
38
public SessionState (
You can’t perform that action at this time.
0 commit comments