File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -228,13 +228,21 @@ private async Task InitializeServicesAsync(CancellationToken cancellationToken =
228228 var attemptCoderConnection = settingsTask . Result ? . ConnectOnLaunch ?? false ;
229229 if ( dependenciesLoaded && attemptCoderConnection )
230230 {
231- try
231+ var rpcModel = rpcController . GetState ( ) ;
232+ if ( rpcModel . VpnLifecycle == VpnLifecycle . Stopped )
232233 {
233- await rpcController . StartVpn ( cancellationToken ) ;
234+ try
235+ {
236+ await rpcController . StartVpn ( cancellationToken ) ;
237+ }
238+ catch ( Exception ex )
239+ {
240+ _logger . LogError ( ex , "Failed to connect on launch" ) ;
241+ }
234242 }
235- catch ( Exception ex )
243+ else
236244 {
237- _logger . LogError ( ex , "Failed to connect on launch") ;
245+ _logger . LogInformation ( $ "Not connecting on launch, VPN lifecycle is { rpcModel . VpnLifecycle } ") ;
238246 }
239247 }
240248
You can’t perform that action at this time.
0 commit comments