diff --git a/result/server.js b/result/server.js index bd9cfc2..0d0c60c 100644 --- a/result/server.js +++ b/result/server.js @@ -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); }); diff --git a/worker/src/Worker/Program.cs b/worker/src/Worker/Program.cs index 83ea264..000fd3d 100644 --- a/worker/src/Worker/Program.cs +++ b/worker/src/Worker/Program.cs @@ -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); } }