From d5f145c0ff2146950a5451003f7b573ffcb72463 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Sat, 13 Dec 2014 01:22:43 -0800 Subject: [PATCH] add error message when can't pink hft.net --- server/hftsite.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/hftsite.js b/server/hftsite.js index da0e7fac..4632b8e2 100644 --- a/server/hftsite.js +++ b/server/hftsite.js @@ -34,6 +34,7 @@ var config = require('../lib/config'); var debug = require('debug')('hftsite'); var io = require('../lib/io'); +var url = require('url'); var g = { throttleTime: 1000, @@ -59,11 +60,13 @@ var inform = (function() { lastTime = now; lastAddressesAsStr = g.addressesAsStr; lastPort = g.port; - var url = process.env.HFT_RENDEZVOUS_URL || config.getSettings().settings.rendezvousUrl; - debug("ping: " + url); - io.sendJSON(url, { addresses: g.addresses, port: g.port }, {}, function(err, result) { + var hftUrl = process.env.HFT_RENDEZVOUS_URL || config.getSettings().settings.rendezvousUrl; + var parsedUrl = url.parse(hftUrl); + debug("ping: " + hftUrl); + io.sendJSON(hftUrl, { addresses: g.addresses, port: g.port }, {}, function(err, result) { // do I care? if (err) { + console.error("Could not contact: " + parsedUrl.host); console.error(err); } });