File tree Expand file tree Collapse file tree 1 file changed +28
-9
lines changed
src/Microsoft.IdentityModel.Protocols/Configuration Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -248,22 +248,41 @@ public virtual async Task<T> GetConfigurationAsync(CancellationToken cancel)
248
248
{
249
249
if ( _refreshRequested )
250
250
{
251
- // Log as manual because RequestRefresh was called
252
- TelemetryClient . IncrementConfigurationRefreshRequestCounter (
253
- MetadataAddress ,
254
- TelemetryConstants . Protocols . Manual ) ;
251
+ _refreshRequested = false ;
252
+
253
+ try
254
+ {
255
+ // Log as manual because RequestRefresh was called
256
+ TelemetryClient . IncrementConfigurationRefreshRequestCounter (
257
+ MetadataAddress ,
258
+ TelemetryConstants . Protocols . Manual ) ;
259
+ }
260
+ #pragma warning disable CA1031 // Do not catch general exception types
261
+ catch
262
+ { }
263
+ #pragma warning restore CA1031 // Do not catch general exception types
255
264
256
265
UpdateCurrentConfiguration ( ) ;
257
- _refreshRequested = false ;
258
266
}
259
- else
267
+ else if ( SyncAfter <= _timeProvider . GetUtcNow ( ) )
260
268
{
261
- TelemetryClient . IncrementConfigurationRefreshRequestCounter (
262
- MetadataAddress ,
263
- TelemetryConstants . Protocols . Automatic ) ;
269
+ try
270
+ {
271
+ TelemetryClient . IncrementConfigurationRefreshRequestCounter (
272
+ MetadataAddress ,
273
+ TelemetryConstants . Protocols . Automatic ) ;
274
+ }
275
+ #pragma warning disable CA1031 // Do not catch general exception types
276
+ catch
277
+ { }
278
+ #pragma warning restore CA1031 // Do not catch general exception types
264
279
265
280
_ = Task . Run ( UpdateCurrentConfiguration , CancellationToken . None ) ;
266
281
}
282
+ else
283
+ {
284
+ Interlocked . Exchange ( ref _configurationRetrieverState , ConfigurationRetrieverIdle ) ;
285
+ }
267
286
}
268
287
}
269
288
You can’t perform that action at this time.
0 commit comments