예제 #1
0
        public static string GetMasterUrl()
        {
            HelperLib.RoleInfoDataSource rids = new HelperLib.RoleInfoDataSource();
            int numTries = 100;

            while (--numTries > 0) // try multiple times since master may be initializing
            {
                try
                {
                    IPEndPoint endpoint = rids.GetMasterEndpoint().IPEndpoint;

                    if (!CheckEndpoint(endpoint))
                        throw new ApplicationException("Master not ready");

                    string masterUrl = "http://" + endpoint.ToString() + "/solr/";
                    return masterUrl;
                }
                catch
                {
                    Thread.Sleep(10000);
                }
            }

            throw new ApplicationException("Master not ready");
        }
예제 #2
0
        public static string GetMasterUrl()
        {
            HelperLib.RoleInfoDataSource rids = new HelperLib.RoleInfoDataSource();
            int numTries = 100;

            while (--numTries > 0) // try multiple times since master may be initializing
            {
                try
                {
                    IPEndPoint endpoint = rids.GetMasterEndpoint().IPEndpoint;
                    
                    if (!CheckEndpoint(endpoint))
                        throw new ApplicationException("Master not ready");

                    string masterUrl = "http://" + endpoint.ToString() + "/solr/";
                    return masterUrl;
                }
                catch
                {
                    Thread.Sleep(10000);
                }
            }

            throw new ApplicationException("Master not ready");
        }