예제 #1
0
        internal void DoStart()
        {
            ConsoleWriteLine();
            ConsoleWriteLine("Starting Repository...");
            ConsoleWriteLine();

            if (_settings.TraceCategories != null)
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories(_settings.TraceCategories);
            }
            else
            {
                LoggingSettings.SnTraceConfigurator.UpdateStartupCategories();
            }

            SearchManager.SetSearchEngineSupport(new SearchEngineSupport());

            InitializeLogger();

            RegisterAppdomainEventHandlers();

            if (_settings.IndexPath != null)
            {
                SearchManager.SetIndexDirectoryPath(_settings.IndexPath);
            }

            LoadAssemblies(_settings.IsWebContext);

            InitializeDataProviderExtensions();

            SecurityHandler.StartSecurity(_settings.IsWebContext);

            SnQueryVisitor.VisitorExtensionTypes = new[] { typeof(Sharing.SharingVisitor) };

            // We have to log the access provider here because it cannot be logged
            // during creation as it would lead to a circular reference.
            SnLog.WriteInformation($"AccessProvider created: {AccessProvider.Current?.GetType().FullName}");

            using (new SystemAccount())
                StartManagers();

            if (_settings.TraceCategories != null)
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories(_settings.TraceCategories);
            }
            else
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories();
            }

            InitializeOAuthProviders();

            ConsoleWriteLine();
            ConsoleWriteLine("Repository has started.");
            ConsoleWriteLine();

            _startupInfo.Started = DateTime.UtcNow;
        }
        internal void DoStart()
        {
            ConsoleWriteLine();
            ConsoleWriteLine("Starting Repository...");
            ConsoleWriteLine();

            if (_settings.TraceCategories != null)
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories(_settings.TraceCategories);
            }
            else
            {
                LoggingSettings.SnTraceConfigurator.UpdateStartupCategories();
            }

            TypeHandler.Initialize(_settings.Providers);

            SearchManager.SetSearchEngineSupport(new SearchEngineSupport());

            InitializeLogger();

            CounterManager.Start();

            RegisterAppdomainEventHandlers();

            if (_settings.IndexPath != null)
            {
                SearchManager.SetIndexDirectoryPath(_settings.IndexPath);
            }

            LoadAssemblies();

            SecurityHandler.StartSecurity(_settings.IsWebContext);

            using (new SystemAccount())
                StartManagers();

            if (_settings.TraceCategories != null)
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories(_settings.TraceCategories);
            }
            else
            {
                LoggingSettings.SnTraceConfigurator.UpdateCategories();
            }

            InitializeOAuthProviders();

            ConsoleWriteLine();
            ConsoleWriteLine("Repository has started.");
            ConsoleWriteLine();

            _startupInfo.Started = DateTime.UtcNow;
        }