From c32fdabc436b339bc6807c205e7b81a00cd29b1a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 18 Sep 2014 21:20:05 -0400 Subject: [PATCH] minor refactor --- src/meta.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/meta.js b/src/meta.js index c923670c5f..09e9a6d134 100644 --- a/src/meta.js +++ b/src/meta.js @@ -30,18 +30,21 @@ var async = require('async'), }; Meta.reload = function(callback) { - plugins.reload(function() { - async.parallel([ - async.apply(Meta.js.minify, false), - async.apply(Meta.css.minify), - async.apply(Meta.templates.compile) - ], function(err) { - if (!err) { - emitter.emit('nodebb:ready'); - } + async.series([ + async.apply(plugins.reload), + function(next) { + async.parallel([ + async.apply(Meta.js.minify, false), + async.apply(Meta.css.minify), + async.apply(Meta.templates.compile) + ], next); + } + ], function(err) { + if (!err) { + emitter.emit('nodebb:ready'); + } - if (callback) callback.apply(null, arguments); - }); + if (callback) callback.apply(null, arguments); }); };