File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -27,25 +27,18 @@ public virtual async Task<Cluster> LoadAsync()
2727
2828 _logger . LogInformation ( "Loading cluster capacity policy..." ) ;
2929
30- try
30+ using ( var reader = await _client . AdminClient . ExecuteControlCommandAsync ( "" , ".show cluster policy capacity" , new ClientRequestProperties ( ) ) )
3131 {
32- using ( var reader = await _client . AdminClient . ExecuteControlCommandAsync ( "" , ".show cluster policy capacity" , new ClientRequestProperties ( ) ) )
32+ if ( reader . Read ( ) )
3333 {
34- if ( reader . Read ( ) )
34+ var policyJson = reader [ "Policy" ] ? . ToString ( ) ;
35+ if ( ! string . IsNullOrEmpty ( policyJson ) )
3536 {
36- var policyJson = reader [ "Policy" ] ? . ToString ( ) ;
37- if ( ! string . IsNullOrEmpty ( policyJson ) )
38- {
39- var policy = JsonConvert . DeserializeObject < ClusterCapacityPolicy > ( policyJson ) ;
40- cluster . CapacityPolicy = policy ;
41- }
37+ var policy = JsonConvert . DeserializeObject < ClusterCapacityPolicy > ( policyJson ) ;
38+ cluster . CapacityPolicy = policy ;
4239 }
4340 }
4441 }
45- catch ( System . Exception ex )
46- {
47- _logger . LogError ( ex , "Failed to load cluster capacity policy." ) ;
48- }
4942
5043 return cluster ;
5144 }
You can’t perform that action at this time.
0 commit comments