/// <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); } }
public void Dispose() { _serverRegister.Deregister(ServiceId); }