@@ -39,19 +39,19 @@ public sealed class JobServerQueue : RunnerService, IJobServerQueue
39
39
private Guid _jobTimelineRecordId ;
40
40
41
41
// queue for web console line
42
- private readonly ConcurrentQueue < ConsoleLineInfo > _webConsoleLineQueue = new ConcurrentQueue < ConsoleLineInfo > ( ) ;
42
+ private readonly ConcurrentQueue < ConsoleLineInfo > _webConsoleLineQueue = new ( ) ;
43
43
44
44
// queue for file upload (log file or attachment)
45
- private readonly ConcurrentQueue < UploadFileInfo > _fileUploadQueue = new ConcurrentQueue < UploadFileInfo > ( ) ;
45
+ private readonly ConcurrentQueue < UploadFileInfo > _fileUploadQueue = new ( ) ;
46
46
47
47
// queue for timeline or timeline record update (one queue per timeline)
48
- private readonly ConcurrentDictionary < Guid , ConcurrentQueue < TimelineRecord > > _timelineUpdateQueue = new ConcurrentDictionary < Guid , ConcurrentQueue < TimelineRecord > > ( ) ;
48
+ private readonly ConcurrentDictionary < Guid , ConcurrentQueue < TimelineRecord > > _timelineUpdateQueue = new ( ) ;
49
49
50
50
// indicate how many timelines we have, we will process _timelineUpdateQueue base on the order of timeline in this list
51
- private readonly List < Guid > _allTimelines = new List < Guid > ( ) ;
51
+ private readonly List < Guid > _allTimelines = new ( ) ;
52
52
53
53
// bufferd timeline records that fail to update
54
- private readonly Dictionary < Guid , List < TimelineRecord > > _bufferedRetryRecords = new Dictionary < Guid , List < TimelineRecord > > ( ) ;
54
+ private readonly Dictionary < Guid , List < TimelineRecord > > _bufferedRetryRecords = new ( ) ;
55
55
56
56
// Task for each queue's dequeue process
57
57
private Task _webConsoleLineDequeueTask ;
@@ -61,8 +61,8 @@ public sealed class JobServerQueue : RunnerService, IJobServerQueue
61
61
// common
62
62
private IJobServer _jobServer ;
63
63
private Task [ ] _allDequeueTasks ;
64
- private readonly TaskCompletionSource < int > _jobCompletionSource = new TaskCompletionSource < int > ( ) ;
65
- private readonly TaskCompletionSource < int > _jobRecordUpdated = new TaskCompletionSource < int > ( ) ;
64
+ private readonly TaskCompletionSource < int > _jobCompletionSource = new ( ) ;
65
+ private readonly TaskCompletionSource < int > _jobRecordUpdated = new ( ) ;
66
66
private bool _queueInProcess = false ;
67
67
68
68
public TaskCompletionSource < int > JobRecordUpdated => _jobRecordUpdated ;
@@ -237,8 +237,8 @@ private async Task ProcessWebConsoleLinesQueueAsync(bool runOnce = false)
237
237
}
238
238
239
239
// Group consolelines by timeline record of each step
240
- Dictionary < Guid , List < TimelineRecordLogLine > > stepsConsoleLines = new Dictionary < Guid , List < TimelineRecordLogLine > > ( ) ;
241
- List < Guid > stepRecordIds = new List < Guid > ( ) ; // We need to keep lines in order
240
+ Dictionary < Guid , List < TimelineRecordLogLine > > stepsConsoleLines = new ( ) ;
241
+ List < Guid > stepRecordIds = new ( ) ; // We need to keep lines in order
242
242
int linesCounter = 0 ;
243
243
ConsoleLineInfo lineInfo ;
244
244
while ( _webConsoleLineQueue . TryDequeue ( out lineInfo ) )
@@ -264,7 +264,7 @@ private async Task ProcessWebConsoleLinesQueueAsync(bool runOnce = false)
264
264
{
265
265
// Split consolelines into batch, each batch will container at most 100 lines.
266
266
int batchCounter = 0 ;
267
- List < List < TimelineRecordLogLine > > batchedLines = new List < List < TimelineRecordLogLine > > ( ) ;
267
+ List < List < TimelineRecordLogLine > > batchedLines = new ( ) ;
268
268
foreach ( var line in stepsConsoleLines [ stepRecordId ] )
269
269
{
270
270
var currentBatch = batchedLines . ElementAtOrDefault ( batchCounter ) ;
@@ -338,7 +338,7 @@ private async Task ProcessFilesUploadQueueAsync(bool runOnce = false)
338
338
{
339
339
while ( ! _jobCompletionSource . Task . IsCompleted || runOnce )
340
340
{
341
- List < UploadFileInfo > filesToUpload = new List < UploadFileInfo > ( ) ;
341
+ List < UploadFileInfo > filesToUpload = new ( ) ;
342
342
UploadFileInfo dequeueFile ;
343
343
while ( _fileUploadQueue . TryDequeue ( out dequeueFile ) )
344
344
{
@@ -398,13 +398,13 @@ private async Task ProcessTimelinesUpdateQueueAsync(bool runOnce = false)
398
398
{
399
399
while ( ! _jobCompletionSource . Task . IsCompleted || runOnce )
400
400
{
401
- List < PendingTimelineRecord > pendingUpdates = new List < PendingTimelineRecord > ( ) ;
401
+ List < PendingTimelineRecord > pendingUpdates = new ( ) ;
402
402
foreach ( var timeline in _allTimelines )
403
403
{
404
404
ConcurrentQueue < TimelineRecord > recordQueue ;
405
405
if ( _timelineUpdateQueue . TryGetValue ( timeline , out recordQueue ) )
406
406
{
407
- List < TimelineRecord > records = new List < TimelineRecord > ( ) ;
407
+ List < TimelineRecord > records = new ( ) ;
408
408
TimelineRecord record ;
409
409
while ( recordQueue . TryDequeue ( out record ) )
410
410
{
@@ -426,7 +426,7 @@ private async Task ProcessTimelinesUpdateQueueAsync(bool runOnce = false)
426
426
// we need track whether we have new sub-timeline been created on the last run.
427
427
// if so, we need continue update timeline record even we on the last run.
428
428
bool pendingSubtimelineUpdate = false ;
429
- List < Exception > mainTimelineRecordsUpdateErrors = new List < Exception > ( ) ;
429
+ List < Exception > mainTimelineRecordsUpdateErrors = new ( ) ;
430
430
if ( pendingUpdates . Count > 0 )
431
431
{
432
432
foreach ( var update in pendingUpdates )
@@ -529,7 +529,7 @@ private List<TimelineRecord> MergeTimelineRecords(List<TimelineRecord> timelineR
529
529
return timelineRecords ;
530
530
}
531
531
532
- Dictionary < Guid , TimelineRecord > dict = new Dictionary < Guid , TimelineRecord > ( ) ;
532
+ Dictionary < Guid , TimelineRecord > dict = new ( ) ;
533
533
foreach ( TimelineRecord rec in timelineRecords )
534
534
{
535
535
if ( rec == null )
0 commit comments