private void RegistrarOnContainerDeleted(object sender, ContainerDeletedEventArgs e)
        {
            foreach (var service in e.Services)
            {
                try
                {
                    _client.DeregisterContainerService(e.ContainerId, service.ServiceName, CancellationToken.None).Wait();
                }
                catch (Exception exception)
                {
                    Logger.Warn(exception,
                                $"Error when trying to deregistered container [{e.ContainerId.ToShortContainerName()}] service [{service.ServiceName}].");
                }
            }

            Logger.Info(
                $"Deregistered container [{e.ContainerId.ToShortContainerName()}] services [{string.Join(", ", e.Services.Select(x => x.ServiceName))}].");
        }
Example #2
0
 private void OnContainerDeleted(ContainerRegistrarTransaction transaction, ContainerDeletedEventArgs e)
 {
     ContainerDeleted?.Invoke(transaction, e);
 }