Exemplo n.º 1
0
        protected override void ConcreteExecute(IJobExecutionContext context)
        {
            RavenDbUtils.TryCreatingFacets(Store);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Finished generating facets...");
        }
Exemplo n.º 2
0
        private static void TryCreatingIndexesOrRedirectToErrorPage()
        {
            try
            {
                RavenDbUtils.TryCreatingIndexes(DocumentStoreHolder.DocumentStore);
            }
            catch (WebException e)
            {
                var socketException = e.InnerException as SocketException;
                if (socketException == null)
                {
                    throw;
                }

                switch (socketException.SocketErrorCode)
                {
                case SocketError.AddressNotAvailable:
                case SocketError.NetworkDown:
                case SocketError.NetworkUnreachable:
                case SocketError.ConnectionAborted:
                case SocketError.ConnectionReset:
                case SocketError.TimedOut:
                case SocketError.ConnectionRefused:
                case SocketError.HostDown:
                case SocketError.HostUnreachable:
                case SocketError.HostNotFound:
                    HttpContext.Current.Response.Redirect("~/RavenNotReachable.htm");
                    break;

                default:
                    throw;
                }
            }
        }