Ejemplo n.º 1
0
        public ActionResult Status()
        {
            try {
                if (_cacheClient.Get <string>("__PING__") != null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable, "Cache Not Working"));
                }
            } catch (Exception ex) {
                return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable, "Cache Not Working: " + ex.Message));
            }

            try {
                if (!GlobalApplication.IsDbUpToDate())
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable, "Mongo DB Schema Outdated"));
                }
            } catch (Exception ex) {
                return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable, "Mongo Not Working: " + ex.Message));
            }

            if (!_notificationSender.IsListening())
            {
                return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable, "Ping Not Received"));
            }

            return(new ContentResult {
                Content = "All Systems Check"
            });
        }