_logger.LogInformation("Beginning initialization of ClusterChat");
foreach (var client in _clients)
{
bool authenticated = false;
try
{
await client.Item2.ConnectAsync();
authenticated = await client.Item2.AuthenticateAsync(client.Item1.RconPassword);
}
catch (Exception ex)
{
_logger.LogError(ex, $"Initialization of ClusterChat server {client.Item1.Name} with key {client.Item1.Key} failed.");
continue;
}
if (authenticated)
{
_logger.LogInformation($"ClusterChat successfully initialized for server {client.Item1.Name}.");
}
else
{
_logger.LogError($"Initialization of ClusterChat server {client.Item1.Key} failed.");
_clients.Remove(client);
continue;
}
}
// This logger line isn't executing when an exception is caught above...?
_logger.LogInformation("Initialization of ClusterChat complete.");
_logger.LogInformation("Beginning initialization of ClusterChat");
foreach (var client in _clients)
{
bool authenticated = false;
try
{
await client.Item2.ConnectAsync();
authenticated = await client.Item2.AuthenticateAsync(client.Item1.RconPassword);
}
catch (Exception ex)
{
_logger.LogError(ex, $"Initialization of ClusterChat server {client.Item1.Name} with key {client.Item1.Key} failed.");
continue;
}
if (authenticated)
{
_logger.LogInformation($"ClusterChat successfully initialized for server {client.Item1.Name}.");
}
else
{
_logger.LogError($"Initialization of ClusterChat server {client.Item1.Key} failed.");
_clients.Remove(client);
continue;
}
}
// This logger line isn't executing when an exception is caught above...?
_logger.LogInformation("Initialization of ClusterChat complete.");