File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ public abstract class BaseExtractor<TConfig> : IDisposable, IAsyncDisposable
7777 /// </summary>
7878 protected RemoteConfigManager < TConfig > ? ConfigManager { get ; }
7979
80+ /// <summary>
81+ /// Timeout in milliseconds for the scheduler to shut down when closing.
82+ /// Defaults to 0, which waits forever.
83+ /// </summary>
84+ protected int SchedulerExitTimeoutMs { get ; set ; }
85+
8086 private readonly ILogger < BaseExtractor < TConfig > > _logger ;
8187
8288 /// <summary>
@@ -383,7 +389,7 @@ protected virtual void Dispose(bool disposing)
383389 try
384390 {
385391 // Cannot be allowed to fail here
386- Scheduler . ExitAllAndWait ( ) . Wait ( ) ;
392+ Scheduler . ExitAllAndWait ( SchedulerExitTimeoutMs ) . Wait ( ) ;
387393 }
388394 catch { }
389395 Scheduler . Dispose ( ) ;
@@ -417,7 +423,7 @@ protected virtual async ValueTask DisposeAsyncCore()
417423 {
418424 try
419425 {
420- await Scheduler . ExitAllAndWait ( ) . ConfigureAwait ( false ) ;
426+ await Scheduler . ExitAllAndWait ( SchedulerExitTimeoutMs ) . ConfigureAwait ( false ) ;
421427 }
422428 catch ( Exception ex )
423429 {
Original file line number Diff line number Diff line change 1- 1.33 .0
1+ 1.34 .0
You can’t perform that action at this time.
0 commit comments