public void OnPost() { string[] months = Request.Form["month"].ToString().Split(new char[] { ';' }); string[] trajects = Request.Form["traject"].ToString().Split(new char[] { ';' }); _logger.LogInformation($"Adding {months.Length * trajects.Length} tasks"); foreach(string month in months) { foreach(string traject in trajects) { BeMobileTaskModel task = new BeMobileTaskModel { BlobName = Request.Form["blobName"], BlobKey = Request.Form["blobKey"], BlobContainer = Request.Form["blobContainer"], Month = month, Traject = traject, CosmosUrl = Request.Form["cosmosUrl"], CosmosKey = Request.Form["cosmosKey"], DatabaseName = Request.Form["OutputDB"], CollectionName = Request.Form["OutputColl"], }; _blockingQueue.JobQueue.Add(task); } } }
private void DoWork() { _logger.LogInformation("Blob Background Service is working."); while (isRunning) { if (_threadPool.GetLock(10000) > 0) { BeMobileTaskModel task = _queue.JobQueue.Take(); _logger.LogInformation("Processing new Blob task from queue"); task.Execute(_logger, _queue); _threadPool.ReleaseLock(); _logger.LogInformation("Finished processing Blob task from queue"); _queue.JobsFinished += 1; } } }