Skip to content

Commit

Permalink
Load configurations synchronously
Browse files Browse the repository at this point in the history
Ensures that, whenever settings are requested, they have already been loaded.
  • Loading branch information
nmalkin committed Jul 13, 2012
1 parent a4a477c commit 5dfb406
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/lib/config.js
Expand Up @@ -11,10 +11,8 @@ var fs = require('fs');
* @param {function} callback the callback to call with the data
*/
function readFile(filename, callback) {
fs.readFile(__dirname + filename, 'utf-8', function(err, data) {
if(err) throw err;
callback(JSON.parse(data));
});
var data = fs.readFileSync(__dirname + filename, 'utf-8');
callback(JSON.parse(data));
}

/**
Expand Down

0 comments on commit 5dfb406

Please sign in to comment.