Use promises instead of async in font concatenation (remove async dependency)

This commit is contained in:
Petr Sloup
2017-05-10 10:22:39 +02:00
parent 5d93b1d4f9
commit bdc3d20524
5 changed files with 36 additions and 41 deletions

View File

@@ -91,9 +91,12 @@ module.exports = function(options, repo, params, id, dataResolver) {
var parts = req.url.split('/');
var fontstack = unescape(parts[2]);
var range = parts[3].split('.')[0];
utils.getFontsPbf(null, options.paths[protocol], fontstack, range, existingFonts,
function(err, concated) {
callback(err, {data: concated});
utils.getFontsPbf(
null, options.paths[protocol], fontstack, range, existingFonts
).then(function(concated) {
callback(null, {data: concated});
}, function(err) {
callback(err, {data: null});
});
} else if (protocol == 'mbtiles') {
var parts = req.url.split('/');