예제 #1
0
        public async Task <IActionResult> CreateAnalysis([FromQuery] string fileName)
        {
            try
            {
                var analysisScriptOptions = _configuration.GetSection("AnalysisScriptOptions").Get <ScriptOptions>();
                var script = new AnalysisScript(analysisScriptOptions, fileName);

                var output = await _scriptService.ExecuteAsync(script, new SignalRArgument <string> {
                    Id = fileName, Category = "CreateAnalysis"
                });

                await _analysisRepository.CreateAnalysisLog(script.SampleName, output);

                return(new OkResult());
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Analysis of {fileName} failed");
            }

            return(new StatusCodeResult(StatusCodes.Status500InternalServerError));
        }