Beispiel #1
0
 private void GenerateIndexesFor(string node)
 {
     Task.Factory.StartNew(() =>
                                 {
                                     var generator = new CacheWarmer(_host);
                                     generator.TraverseFrom(node);
                                 });
 }
Beispiel #2
0
 private void GenerateIndexesFor(string node)
 {
     Task.Factory.StartNew(() =>
     {
         var generator = new CacheWarmer(_host);
         generator.TraverseFrom(node);
     });
 }
        private void EnsureCacheWarmed()
        {
            var host = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);

            if (_context.IsFirstRun) // lets warm up the cache if this is the first request
            {
                lock (Mutex)
                {
                    if (!_context.IsFirstRun) return;
                    _context.IsFirstRun = false;

                    Task.Factory.StartNew(() =>
                                              {
                                                  var cacheWarmer = new CacheWarmer(host);
                                                  cacheWarmer.TraverseFrom("/");
                                              });
                }
            }
        }
        private void EnsureCacheWarmed()
        {
            var host = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);

            if (_context.IsFirstRun) // lets warm up the cache if this is the first request
            {
                lock (Mutex)
                {
                    if (!_context.IsFirstRun)
                    {
                        return;
                    }
                    _context.IsFirstRun = false;

                    Task.Factory.StartNew(() =>
                    {
                        var cacheWarmer = new CacheWarmer(host);
                        cacheWarmer.TraverseFrom("/");
                    });
                }
            }
        }