Skip to content

Commit

Permalink
better config checking for database config
Browse files Browse the repository at this point in the history
  • Loading branch information
chelm committed Feb 17, 2015
1 parent 5e0fba1 commit 602981c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ module.exports = function( config ) {

// registers a DB modules
app.registerCache = function( adapter ){
koop.Cache.db = adapter.connect( config.db.conn, koop );
if ( config.db && config.db.conn ) {
koop.Cache.db = adapter.connect( config.db.conn, koop );
}
else {
console.log('Cannot register this cache, missing db connection in config');
}
return;
};

Expand Down

0 comments on commit 602981c

Please sign in to comment.