From 036c119e2c94f8522b2978ff27a0707d7aaead3f Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Sun, 19 Jun 2016 21:32:18 -0700 Subject: [PATCH] Reword connection retry messages --- result/server.js | 2 +- worker/src/Worker/Program.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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); } }