@@ -132,7 +132,10 @@ private void OnSettingsChanged()
132132 {
133133 if ( _refreshTimer == null )
134134 {
135+ #pragma warning disable S4462 // Calls to "async" methods should not be blocking
136+ // Justification: Configuration sources and providers don't support async.
135137 _refreshTimer = new Timer ( _ => DoPolledLoadAsync ( ) . GetAwaiter ( ) . GetResult ( ) , null , TimeSpan . Zero , ClientOptions . PollingInterval ) ;
138+ #pragma warning restore S4462 // Calls to "async" methods should not be blocking
136139 }
137140 else if ( existingPollingInterval != ClientOptions . PollingInterval )
138141 {
@@ -197,7 +200,10 @@ private async Task DoPolledLoadAsync()
197200 /// </summary>
198201 public override void Load ( )
199202 {
203+ #pragma warning disable S4462 // Calls to "async" methods should not be blocking
204+ // Justification: Configuration sources and providers don't support async.
200205 LoadInternalAsync ( true , CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) ;
206+ #pragma warning restore S4462 // Calls to "async" methods should not be blocking
201207 }
202208
203209 internal async Task < ConfigEnvironment ? > LoadInternalAsync ( bool updateDictionary , CancellationToken cancellationToken )
@@ -695,8 +701,11 @@ private void AddPropertySource(PropertySource? source, Dictionary<string, string
695701
696702 private void RenewToken ( )
697703 {
704+ #pragma warning disable S4462 // Calls to "async" methods should not be blocking
705+ // Justification: Configuration sources and providers don't support async.
698706 _ = new Timer ( _ => RefreshVaultTokenAsync ( CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) , null ,
699707 TimeSpan . FromMilliseconds ( ClientOptions . TokenRenewRate ) , TimeSpan . FromMilliseconds ( ClientOptions . TokenRenewRate ) ) ;
708+ #pragma warning restore S4462 // Calls to "async" methods should not be blocking
700709 }
701710
702711 // fire and forget
0 commit comments