Example #1
0
        public static void Configure()
        {
            DbRegistry.Configure();

            PrepareRedisSessionProvider();

            if (HttpContext.Current != null && HttpContext.Current.Request != null)
            {
                var url = HttpContext.Current.Request.GetUrlRewriter();
                CommonLinkUtility.Initialize(new UriBuilder(url.Scheme, url.Host, url.Port).Uri.ToString());
            }

            ConfigureWebApi();

            if (DBResourceManager.ResourcesFromDataBase)
            {
                DBResourceManager.WhiteLableEnabled = true;
                DBResourceManager.PatchAssemblies();
            }

            AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;
            AppDomain.CurrentDomain.AssemblyResolve             += CurrentDomainOnAssemblyResolve;

            //try
            //{
            //    AmiPublicDnsSyncService.Synchronize();
            //}
            //catch { }

            NotifyConfiguration.Configure();

            WebItemManager.Instance.LoadItems();

            SearchHandlerManager.Registry(new StudioSearchHandler());

            StorageFactory.InitializeHttpHandlers();

            BundleConfig.Configure();

            WhiteLabelHelper.ApplyPartnerWhiteLableSettings();

            LdapNotifyHelper.RegisterAll();

            try
            {
                new S3UploadGuard().DeleteExpiredUploadsAsync(TimeSpan.FromDays(1));//todo:
            }
            catch (Exception)
            {
            }

            try
            {
                Core.WarmUp.Instance.Start();
            }
            catch (Exception ex)
            {
                LogManager.GetLogger("ASC").Error("Start Warmup", ex);
            }
        }
Example #2
0
 protected void Application_Start(object sender, EventArgs e)
 {
     XmlConfigurator.Configure();
     DbRegistry.Configure();
     ConfigureServiceLocator();
     (new S3UploadGuard()).DeleteExpiredUploadsAsync(TimeSpan.FromDays(1));
     DBResourceManager.PatchAssemblies();
 }
Example #3
0
        private static void InitializeDbResources()
        {
            if (!Settings.ResourcesFromDataBase)
            {
                return;
            }

            DBResourceManager.PatchAssemblies();
            DBResourceManager.PatchAssembly(Assembly.GetExecutingAssembly(), false);
        }
Example #4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            XmlConfigurator.Configure();
            DbRegistry.Configure();
            ConfigureServiceLocator();
            (new S3UploadGuard()).DeleteExpiredUploadsAsync(TimeSpan.FromDays(1));

            if (ConfigurationManagerExtension.AppSettings["resources.from-db"] == "true")
            {
                DBResourceManager.PatchAssemblies();
            }
        }
Example #5
0
        public static void StartService()
        {
            DBResourceManager.PatchAssemblies();
            var url = HealthCheckCfgSectionHandler.Instance.Url;

            log.DebugFormat("StartSevice: RunHealthCheckService. url: {0}", url);
            webApiHost = WebApp.Start <Startup>(url);

            /* Hack for mono because first requests can failed.
             * https://bugzilla.xamarin.com/show_bug.cgi?format=multiple&id=17965
             */
            var warmingUpper = new WarmingUpper();

            warmingUpper.WarmingUp(url);

            HealthCheckRunner.Run();
        }
        public static void Configure()
        {
            XmlConfigurator.Configure();

            DbRegistry.Configure();

            PrepareRedisSessionProvider();

            if (HttpContext.Current != null && HttpContext.Current.Request != null)
            {
                var url = HttpContext.Current.Request.GetUrlRewriter();
                CommonLinkUtility.Initialize(new UriBuilder(url.Scheme, url.Host, url.Port).Uri.ToString());
            }

            ConfigureWebApi();

            if (ConfigurationManager.AppSettings["resources.from-db"] == "true")
            {
                DBResourceManager.PatchAssemblies();
            }

            AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;

            try
            {
                AmiPublicDnsSyncService.Synchronize();
            }
            catch { }

            NotifyConfiguration.Configure();

            WebItemManager.Instance.LoadItems();

            SearchHandlerManager.Registry(new StudioSearchHandler());

            StorageFactory.InitializeHttpHandlers();
            (new S3UploadGuard()).DeleteExpiredUploads(TimeSpan.FromDays(1));

            BundleConfig.Configure();

            if (CoreContext.Configuration.Standalone)
            {
                WarmUp.Instance.Start();
            }
        }
Example #7
0
 private void InitializeDbResources()
 {
     DBResourceManager.PatchAssemblies();
 }