Skip to content

Commit

Permalink
take daemon out of main code
Browse files Browse the repository at this point in the history
  • Loading branch information
jtremback committed Oct 10, 2014
1 parent 699160a commit c954877
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/models/pg-utils.js
Expand Up @@ -9,7 +9,7 @@ module.exports = function (connection_string) {
pg.connect(connection_string, function (err, client, done) {
if (err) return callback(err);

var begin_time = Date.now();
// var begin_time = Date.now();

function rollback (err) {
console.log(err, callback);
Expand All @@ -27,7 +27,7 @@ module.exports = function (connection_string) {
function (err) {
if (err) return rollback(err);
done();
console.log('transaction done', Date.now() - begin_time);
// console.log('transaction done', Date.now() - begin_time);
return callback.apply(this, _arguments);
});
};
Expand All @@ -49,7 +49,7 @@ module.exports = function (connection_string) {

var augmentedDone = function (err) {
done(err);
console.log('query done', Date.now() - begin_time);
// console.log('query done', Date.now() - begin_time);
return callback.apply(this, arguments);
};

Expand All @@ -67,7 +67,7 @@ module.exports = function (connection_string) {

var augmentedDone = function (err) {
done(err);
console.log('query done', Date.now() - begin_time);
// console.log('query done', Date.now() - begin_time);
return callback.apply(this, arguments);
};

Expand Down
12 changes: 6 additions & 6 deletions server.js
Expand Up @@ -25,13 +25,13 @@ db.insertPgFunctions(function () {
});


var daemon = require('./app/models/block_io-daemon.js')(6, 20000);
// var daemon = require('./app/models/block_io-daemon.js')(6, 20000);

daemon.on('deposit', log);
daemon.on('error', log);
// daemon.on('deposit', log);
// daemon.on('error', log);

function log (stuff) {
console.log('deposit daemon: ', stuff);
}
// function log (stuff) {
// console.log('deposit daemon: ', stuff);
// }

console.log('Express app started on port ' + port);

0 comments on commit c954877

Please sign in to comment.