示例#1
0
        private static async Task <ConfigModel> LoadAndValidateConfigs(string configsFileDir)
        {
            // log operation
            _logger.LogOperation(OperationType.ReadAndValidateConfigs, $"configs.json");

            // load configs
            var appConfigs = _configsLoader.Load(configsFileDir);

            // validate configs
            var selectedProjects = SelectedProjectsLoader.LoadSelectedProjects(appConfigs.CustomText.Projects);
            await _configsValidationService.ValidateAppConfigs(appConfigs, selectedProjects);

            return(appConfigs);
        }
示例#2
0
        private static async Task RunOperationInternal(string indexName, string configsFileDir)
        {
            // load configs and schema
            var appConfigs = await LoadAndValidateConfigs(configsFileDir);

            var selectedProjects = SelectedProjectsLoader.LoadSelectedProjects(appConfigs.CustomText.Projects);
            var customTextSchema = await LoadAndValidateAppSchema(appConfigs, selectedProjects);

            // build dependencies
            var container = DependencyInjector.BuildDependencies(appConfigs);

            // run
            using (var scope = container.BeginLifetimeScope())
            {
                var orchestrator = scope.Resolve <IndexingOrchestrator>();
                await orchestrator.IndexCustomText(indexName, customTextSchema, selectedProjects);
            }
        }