Reword connection retry messages
This commit is contained in:
parent
82fd54e28f
commit
036c119e2c
@ -26,7 +26,7 @@ async.retry(
|
||||
function(callback) {
|
||||
pg.connect('postgres://postgres@db/postgres', function(err, client, done) {
|
||||
if (err) {
|
||||
console.error("Failed to connect to db");
|
||||
console.error("Waiting for db");
|
||||
}
|
||||
callback(err, client);
|
||||
});
|
||||
|
@ -52,16 +52,18 @@ namespace Worker
|
||||
}
|
||||
catch (SocketException)
|
||||
{
|
||||
Console.Error.WriteLine("Failed to connect to db - retrying");
|
||||
Console.Error.WriteLine("Waiting for db");
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
catch (DbException)
|
||||
{
|
||||
Console.Error.WriteLine("Failed to connect to db - retrying");
|
||||
Console.Error.WriteLine("Waiting for db");
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
Console.Error.WriteLine("Connected to db");
|
||||
|
||||
var command = connection.CreateCommand();
|
||||
command.CommandText = @"CREATE TABLE IF NOT EXISTS votes (
|
||||
id VARCHAR(255) NOT NULL UNIQUE,
|
||||
@ -82,11 +84,12 @@ namespace Worker
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.Error.WriteLine("Connected to redis");
|
||||
return ConnectionMultiplexer.Connect(ipAddress);
|
||||
}
|
||||
catch (RedisConnectionException)
|
||||
{
|
||||
Console.Error.WriteLine("Failed to connect to redis - retrying");
|
||||
Console.Error.WriteLine("Waiting for redis");
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user