Skip to content

Commit

Permalink
Add cb for eventhub (#159)
Browse files Browse the repository at this point in the history
* add discconnect callback for eventhub
* tweak startup logs to include url
  • Loading branch information
dshuffma-ibm committed Oct 10, 2017
1 parent 542f36a commit 6cdce3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.js
Expand Up @@ -163,8 +163,10 @@ if (config_error) {
if (err) {
startup_unsuccessful();
} else {
console.log('\n');
logger.debug('Detected that we have launched successfully before');
logger.debug('Welcome back - Initiating start up\n\n');
logger.debug('Welcome back - Marbles is ready');
logger.debug('Open your browser to http://' + host + ':' + port + ' and login as "admin"\n\n');
}
});
});
Expand Down
4 changes: 3 additions & 1 deletion utils/fc_wrangler/invoke_cc.js
Expand Up @@ -116,7 +116,7 @@ module.exports = function (g_options, logger) {
options.target_event_url = null; //don't use eventHub
}
if (options.target_event_url) {
logger.debug('[fcw] listening to tx event. url:', options.target_event_url);
logger.debug('[fcw] listening to transaction event. url:', options.target_event_url);
eventHub = client.newEventHub();
eventHub.setPeerAddr(options.target_event_url, options.peer_tls_opts);
eventHub.connect();
Expand All @@ -139,6 +139,8 @@ module.exports = function (g_options, logger) {
return cb(null); //all good, pass it back
} else return;
}
}, function (disconnectMsg) { //callback whenever eventHub is disconnected, normal
logger.debug('[fcw] transaction event is disconnected');
});
} else {
logger.debug('[fcw] will not use tx event');
Expand Down

0 comments on commit 6cdce3f

Please sign in to comment.