Skip to content

Commit

Permalink
add error message when can't pink hft.net
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 13, 2014
1 parent dba4d55 commit d5f145c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/hftsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}
});
Expand Down

0 comments on commit d5f145c

Please sign in to comment.