Example #1
0
        /// <summary>
        /// 从consul中移除
        /// </summary>
        /// <param name="whenException">==null => throw</param>
        public static void RemoveConsul(Action <Exception> whenException = null)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(discoveryEntry?.ServiceId))
                {
                    return;
                }

                serverRegister?.Deregister(discoveryEntry?.ServiceId);
            }
            catch (Exception ex)
            {
                InvokeException(ex, whenException);
            }
        }
Example #2
0
 public void Dispose()
 {
     _serverRegister.Deregister(ServiceId);
 }