File tree 3 files changed +14
-3
lines changed
3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,14 @@ private IEnumerable<IBackgroundProcessDispatcherBuilder> GetRequiredProcesses(
213
213
214
214
if ( ! _options . IsLightweightServer )
215
215
{
216
- processes . Add ( new DelayedJobScheduler ( _options . SchedulePollingInterval , stateChanger ) . UseBackgroundPool ( 1 ) ) ;
216
+ processes . Add (
217
+ new DelayedJobScheduler ( _options . SchedulePollingInterval , stateChanger )
218
+ {
219
+ TaskScheduler = _options . TaskScheduler ,
220
+ MaxDegreeOfParallelism = _options . MaxDegreeOfParallelismForSchedulers
221
+ }
222
+ . UseBackgroundPool ( 1 ) ) ;
223
+
217
224
processes . Add (
218
225
new RecurringJobScheduler ( factory , _options . SchedulePollingInterval , timeZoneResolver )
219
226
{
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ public class DelayedJobScheduler : IBackgroundProcess
81
81
private readonly IBackgroundJobStateChanger _stateChanger ;
82
82
private readonly IProfiler _profiler ;
83
83
private readonly TimeSpan _pollingDelay ;
84
+ private bool _parallelismIssueLogged ;
84
85
85
86
/// <summary>
86
87
/// Initializes a new instance of the <see cref="DelayedJobScheduler"/>
@@ -234,9 +235,10 @@ private int EnqueueNextScheduledJobs(BackgroundProcessContext context)
234
235
}
235
236
else
236
237
{
237
- if ( MaxDegreeOfParallelism > 1 )
238
+ if ( MaxDegreeOfParallelism > 1 && ! _parallelismIssueLogged )
238
239
{
239
240
_logger . Warn ( "Parallel execution is configured but can't be used, because current storage implementation doesn't support batching." ) ;
241
+ _parallelismIssueLogged = true ;
240
242
}
241
243
242
244
for ( var i = 0 ; i < BatchSize ; i ++ )
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ public class RecurringJobScheduler : IBackgroundProcess
78
78
private readonly ITimeZoneResolver _timeZoneResolver ;
79
79
private readonly TimeSpan _pollingDelay ;
80
80
private readonly IProfiler _profiler ;
81
+ private bool _parallelismIssueLogged ;
81
82
82
83
/// <summary>
83
84
/// Initializes a new instance of the <see cref="RecurringJobScheduler"/>
@@ -252,9 +253,10 @@ private int EnqueueNextRecurringJobs(BackgroundProcessContext context)
252
253
}
253
254
else
254
255
{
255
- if ( MaxDegreeOfParallelism > 1 )
256
+ if ( MaxDegreeOfParallelism > 1 && ! _parallelismIssueLogged )
256
257
{
257
258
_logger . Warn ( "Parallel execution is configured but can't be used, because current storage implementation doesn't support batching." ) ;
259
+ _parallelismIssueLogged = true ;
258
260
}
259
261
260
262
for ( var i = 0 ; i < BatchSize ; i ++ )
You can’t perform that action at this time.
0 commit comments