Exemplo n.º 1
0
        private void SetPingdomStatus()
        {
            try
            {
                if (_result.resultset != null)
                {
                    if (_result.resultset.Menu == null || _result.resultset.Menu.Count < 1)
                    {
                        //cperez: pingdomsucess still cover as we check for "AllBrandsBreakdown"
                        //Code below was added to give a retry to FTP file,Menu and Brands to rebuild and
                        //prevent unclickable front-end behaviors.
                        _result.errors.Clear();
                        CacheMemory.ClearCmsCache();
                        SetMenuAndBrands();
                    }

                    if (!_result.success ||
                        _result.resultset.ContentRows == null ||
                        _result.resultset.ContentRows.Count < 1 ||
                        _result.resultset.AllBrandsBreakdown == null ||
                        _result.resultset.AllBrandsBreakdown.Count < 1 ||
                        _result.errors.Count > 0)
                    {
                        _result.resultset.PingdomSuccess = false;
                    }
                }
            }
            catch (Exception ex)
            {
                _result.errors.Add(ex.Handle("Init.SetPingdomStatus: " + ex, ErrorSeverity.FollowUp, ErrorType.RequestError));
            }
        }
Exemplo n.º 2
0
 private static HrefLookup GetHrefLookupConfig(FileInfo fileInfo, HrefLookup result)
 {
     try
     {
         lock (ObjectLock)
         {
             using (var reader = new StreamReader(fileInfo.FullName))
             {
                 var contents = reader.ReadToEnd();
                 if (contents != string.Empty)
                 {
                     result = new HrefLookup(contents);
                 }
             }
         }
     }
     catch (Exception)
     {
         //allow a try on next user
         CacheMemory.ClearMenu();
         CacheMemory.ClearCmsCache();
         result = new HrefLookup();
     }
     return(result);
 }
Exemplo n.º 3
0
        public IResponseBase Execute(IRequestParameter parameters)
        {
            if (EnvironmentHelper.IsProd())
            {
                //sets Icore middle ware to shutdown on response.
                //regardless of the return value.
                CacheMemory.ClearMenu();
                _core.Context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
                _core.Context.Response.Close();
            }
            else
            {
                CacheMemory.ClearCmsCache();
            }
            var result = new Response <EmptyRequest> {
                resultset = new EmptyRequest()
            };

            return(result);
        }