Beispiel #1
0
        private void OnComplete()
        {
            LogManager.GetLogger("ASC").Debug("Complete");

            Link    = VirtualPathUtility.ToAbsolute("~/default.aspx");
            Bundles = BundleTable.Bundles.Select(GetBundlePath).Where(r => !r.Contains("/clientscript/")).ToList();
            WarmUpSettings.SetCompleted(true);
        }
Beispiel #2
0
 internal void Restart()
 {
     Started = false;
     WarmUpSettings.SetCompleted(false);
     progress = new StartupProgress(Urls.Count);
     Publish();
     Start();
 }
Beispiel #3
0
        public void Restart()
        {
            Started = false;
            WarmUpSettings.SetCompleted(false);
            lock (locker)
            {
                progress = new StartupProgress(Urls.Count);
            }

            Publish();
            Start();
        }
Beispiel #4
0
        public bool CheckCompleted()
        {
            if (!successInitialized)
            {
                return(true);
            }
            if (!CoreContext.Configuration.Standalone)
            {
                return(true);
            }
            if (WarmUpSettings.GetCompleted())
            {
                return(true);
            }

            return(startupProgresses.All(pair => pair.Value.Completed));
        }
Beispiel #5
0
        internal void Start()
        {
            if (!successInitialized ||
                (ConfigurationManagerExtension.AppSettings["web.warmup.enabled"] ?? "false") == "false" ||
                WarmUpSettings.GetCompleted())
            {
                progress.Complete();
                return;
            }

            if (!Started)
            {
                Started = true;

                var task = new Task(() =>
                {
                    try
                    {
                        MakeRequest();
                    }
                    catch (Exception ex)
                    {
                        logger.Error("Error", ex);
                        Terminate();
                    }
                    finally
                    {
                        lock (locker)
                        {
                            progress.Complete();
                        }
                        Publish();
                    }
                }, tokenSource.Token, TaskCreationOptions.LongRunning);

                task.ConfigureAwait(false);
                task.Start();
            }
        }