Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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));
            }
        }