Example #1
0
        /// <summary>
        /// This method is called when the app pool starts
        /// </summary>
        public static void InitialLoadConfiguration()
        {
            InternalReloadSiteHostCache();

            List <cmSite> sites         = null;
            SiteRouteInfo siteRouteInfo = null;

            bool preloadRoot = ConfigurationManager.AppSettings["Init.PreloadRootTemplateSiteRouteInfo"].DefaultIfNullOrWhiteSpace("false").Equals("true", StringComparison.InvariantCultureIgnoreCase);

            if (preloadRoot)
            {
                // Load Root Template Sites' RouteInfo
                sites = GetRootTemplateSites();
                {
                    foreach (cmSite site in sites)
                    {
                        siteRouteInfo = new SiteRouteInfo(site);
                        LoadSiteRouteInfo(siteRouteInfo);
                    }
                }
                sites = GetSites().Where(s => !sites.Exists(rs => rs.ID == s.ID)).ToList();
            }
            else
            {
                sites = GetSites();
            }

            if (!string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["Init.Debug.Sites"]))
            {
                //only loads the sites specificed from web.config & template sites, to speed the loading for debug
                sites = GetSites().Where(s => GetRootTemplateSites().Exists(ts => ts.ID == s.ID) || GetDebugSites().Contains(s.ID)).ToList();
            }

            foreach (cmSite site in sites)
            {
                siteRouteInfo = new SiteRouteInfo(site);
                s_DistinctName2DomainRouteInfo[site.DistinctName] = siteRouteInfo;

                BackgroundThreadPool.QueueUserWorkItem("InitialLoadConfiguration", new WaitCallback(LoadSiteRouteInfo), siteRouteInfo, true);
            }
        }
Example #2
0
 public static void UpdateToLatest()
 {
     BackgroundThreadPool.QueueUserWorkItem("DownloadGeoIPDatabase", new WaitCallback(DownloadGeoIPDatabase), null, true);
 }
 public static void Begin()
 {
     BackgroundThreadPool.QueueUserWorkItem("ScalableThumbnailProcessor", ProcessScalableThumbnails, null);
 }
Example #4
0
 public static void Init()
 {
     BackgroundThreadPool.QueueUserWorkItem("ChangeNotifier", LongRunThread, null);
 }