Created
May 26, 2011 15:08
-
-
Save mitechie/993332 to your computer and use it in GitHub Desktop.
#31 node-postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'), | |
pg = require('pg'), | |
inspect = require('sys').inspect; | |
var LISTEN_PORT = 8888, | |
DBSTRING = "tcp://nocontact:nocontact@localhost/nocontact"; | |
var commands = { | |
'check': function (email) { | |
console.log('in check'); | |
pg.connect(DBSTRING, function(err, client) { | |
console.log('connect'); | |
if (err) { | |
console.log("ERROR DB " + err.message); | |
} | |
}); | |
} | |
}; | |
console.log('running'); | |
setInterval(function () { | |
console.log('calling'); | |
commands.check('rharding'); | |
}, 1000); | |
console.log('interval set'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment