Use less memory to build translation files (#6070)

* Change languages build to use less memory

Add graceful-fs so no ned to worry about fs limits

* Specify encoding for fs.readFile

Use eachLimit since graceful-fs handles that now
This commit is contained in:
Peter Jaszkowiak
2017-11-16 15:43:52 -07:00
committed by Barış Soner Uşaklı
parent f5385e38bf
commit c47c47f7e3
17 changed files with 142 additions and 158 deletions

View File

@@ -45,16 +45,16 @@ function renderEmail(req, res, next) {
async.waterfall([
function (next) {
fs.readFile(email, next);
fs.readFile(email, 'utf8', next);
},
function (original, next) {
var text = meta.config['email:custom:' + path] ? meta.config['email:custom:' + path] : original.toString();
var text = meta.config['email:custom:' + path] ? meta.config['email:custom:' + path] : original;
next(null, {
path: path,
fullpath: email,
text: text,
original: original.toString(),
original: original,
});
},
], next);