Exemplo n.º 1
0
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            var op = DetailedLogger.CreateOperation();   // category: general

            DetailedLogger.Log(op, "Application_Start"); // category: general

            var runOnceMarkerPath = application.Server.MapPath("/" + RunOnceGuid);
            var firstRun          = File.Exists(runOnceMarkerPath);
            var startConfig       = new ContentRepository.RepositoryStartSettings {
                StartLuceneManager = !firstRun
            };

            RepositoryInstance.WaitForWriterLockFileIsReleased(RepositoryInstance.WaitForLockFileType.OnStart);

            Repository.Start(startConfig);

            //-- <L2Cache>
            StorageContext.L2Cache = new L2CacheImpl();
            //-- </L2Cache>

            GlobalConfiguration.Configure(WebApiConfiguration.Register);
            RegisterRoutes(RouteTable.Routes, application);
            RepositoryPathProvider.Register();

            //preload
            WarmUp.Preload();

            op.Finish(); // category: general
        }