Skip to content

Commit b3a3d6e

Browse files
committed
Reword connection retry messages
1 parent 6f8f341 commit b3a3d6e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

result/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async.retry(
2626
function(callback) {
2727
pg.connect('postgres://postgres@db/postgres', function(err, client, done) {
2828
if (err) {
29-
console.error("Failed to connect to db");
29+
console.error("Waiting for db");
3030
}
3131
callback(err, client);
3232
});

worker/src/Worker/Program.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,18 @@ private static NpgsqlConnection OpenDbConnection(string connectionString)
5252
}
5353
catch (SocketException)
5454
{
55-
Console.Error.WriteLine("Failed to connect to db - retrying");
55+
Console.Error.WriteLine("Waiting for db");
5656
Thread.Sleep(1000);
5757
}
5858
catch (DbException)
5959
{
60-
Console.Error.WriteLine("Failed to connect to db - retrying");
60+
Console.Error.WriteLine("Waiting for db");
6161
Thread.Sleep(1000);
6262
}
6363
}
6464

65+
Console.Error.WriteLine("Connected to db");
66+
6567
var command = connection.CreateCommand();
6668
command.CommandText = @"CREATE TABLE IF NOT EXISTS votes (
6769
id VARCHAR(255) NOT NULL UNIQUE,
@@ -82,11 +84,12 @@ private static ConnectionMultiplexer OpenRedisConnection(string hostname)
8284
{
8385
try
8486
{
87+
Console.Error.WriteLine("Connected to redis");
8588
return ConnectionMultiplexer.Connect(ipAddress);
8689
}
8790
catch (RedisConnectionException)
8891
{
89-
Console.Error.WriteLine("Failed to connect to redis - retrying");
92+
Console.Error.WriteLine("Waiting for redis");
9093
Thread.Sleep(1000);
9194
}
9295
}

0 commit comments

Comments
 (0)