예제 #1
0
        public async Task <IActionResult> GenerateAsync(string slug, [FromBody] GenerationSettings settings)
        {
            var report = await mongoReportRepository.GetAsync(slug);

            if (report == null)
            {
                return(NotFound());
            }

            var url = await reportGenerationService.GenerateAsync(report, settings);

            return(Ok(url));
        }
        public async Task <bool> HandleAsync(JobContextMessage message, System.Threading.CancellationToken cancellationToken)
        {
            _logger.LogInfo("Entered Message Handler");

            var summarisationReportServiceContext = new SummarisationReportServiceContext(message);

            using (var childLifetimeScope = _lifetimeScope.BeginLifetimeScope())
            {
                var executionContext = (ExecutionContext)childLifetimeScope.Resolve <IExecutionContext>();
                executionContext.JobId = message.JobId.ToString();

                try
                {
                    await _reportGenerationService.GenerateAsync(summarisationReportServiceContext, cancellationToken);
                }
                catch (Exception exception)
                {
                    _logger.LogError("Reference Data Message Handler Exception", exception);
                    throw;
                }

                return(true);
            }
        }