public AnalysisJobsController( TVQContext context, IBaseBackgroundTaskQueue <AnalysisJob> analysisQueue) { _context = context; AnalysisQueue = analysisQueue; }
public LiteratureCrawlingJobsController( TVQContext context, IBaseBackgroundTaskQueue <LiteratureCrawlingJob> queue) { _context = context; Queue = queue; }
public RepoCrawlingJobsController( TVQContext context, IBaseBackgroundTaskQueue <RepoCrawlingJob> queue, ILogger <RepoCrawlingJobsController> logger) { _context = context; _queue = queue; _logger = logger; }
public BaseScheduler( IServiceScopeFactory scopeFactory, ILogger <BaseScheduler <TService, TJob> > logger, IBaseBackgroundTaskQueue <TJob> queue) { ScopeFactory = scopeFactory; Logger = logger; Queue = queue; }
public CitationsController( TVQContext context, IBaseBackgroundTaskQueue <LiteratureCrawlingJob> queue, ILogger <CitationsController> logger) { _context = context; _queue = queue; _logger = logger; }
public static async Task ProcessTaskQueueAsync(IBaseBackgroundTaskQueue taskQueue, IWebLogger logger, CancellationToken stoppingToken) { logger.LogInformation($"Queued Hosted Service {taskQueue.GetType().Name} is " + $"starting on {Environment.MachineName}"); while (!stoppingToken.IsCancellationRequested) { var workItem = await taskQueue.DequeueAsync(stoppingToken); try { await workItem(stoppingToken); } catch (Exception exception) { logger.LogError(exception, $"Error occurred executing workItem ", nameof(workItem)); } } logger.LogInformation("Queued Hosted Service has stopped"); }