public async Task PublishModel([QueueTrigger(QueueNames.PublishModel, Connection = "StorageProdIden")] PublishModelMessage message, ILogger log) { log.LogInformation("PublishModel function called"); log.LogInformation($"Message with iterationId: {message.IterationId}"); await PublishModel(message); }
private async Task PublishModel(PublishModelMessage message) { var published = await _productIdentifyService.TryPublishIteration(message.IterationId); if (!published) { await _queueService.SendDelayedMessageAsync(QueueNames.PublishModel, message, TimeSpan.FromMinutes(5)); } else { var trained = _productTrainingRepository.GetAllTraining(); UpdateTrainedState(trained); } }
private async Task TrainModel() { var toTrain = _productTrainingRepository.GetAllToTrain(); if (toTrain.Any()) { var projectId = await _productIdentifyService.TrainProjectAsync(); var publishMessage = new PublishModelMessage(projectId); UpdateTrainingState(toTrain); await _queueService.SendDelayedMessageAsync(QueueNames.PublishModel, publishMessage, TimeSpan.FromMinutes(10)); } }