Skip to content

Instantly share code, notes, and snippets.

@kmiyashiro
Created June 5, 2012 18:11
Show Gist options
  • Save kmiyashiro/2876644 to your computer and use it in GitHub Desktop.
Save kmiyashiro/2876644 to your computer and use it in GitHub Desktop.
dbready
// Calls done when db is finished connecting
exports.dbReady = function(done) {
var db = require('../../models/db');
switch (db.state) {
case 'connected':
done();
break;
case 'connecting':
db.once('open', done);
break;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment