コード例 #1
0
        /// <summary>
        ///     Launches tasks from the queue
        /// </summary>
        protected async override Task ExecuteAsync(CancellationToken cancellationToken)
        {
            using var scope = _serviceScopeFactory.CreateScope();

            while (!cancellationToken.IsCancellationRequested)
            {
                var buildingTask = await _buildingQueue.DequeueAsync(cancellationToken);

                if (buildingTask.IsDebugging)
                {
                    await RunDebug(scope, buildingTask);
                }
                else
                {
                    await RunToCompletion(scope, buildingTask);
                }
            }
        }