less code

v1.18.x
barisusakli 11 years ago
parent 8e0bc0257d
commit 0e241456e4

@ -75,15 +75,9 @@ var path = require('path'),
}); });
}, },
render: function(callback) { render: function(callback) {
var returnSitemap = function() {
sitemap.obj.toXML(function(xml) {
callback(xml);
});
};
if (sitemap.obj !== undefined && sitemap.obj.cache.length) { if (sitemap.obj !== undefined && sitemap.obj.cache.length) {
console.log('using sitemap from cache!'); console.log('using sitemap from cache!');
returnSitemap(); sitemap.obj.toXML(callback);
} else { } else {
console.log('generating new sitemap!', sitemap.obj); console.log('generating new sitemap!', sitemap.obj);
async.parallel([sitemap.getStaticUrls, sitemap.getDynamicUrls], function(err, urls) { async.parallel([sitemap.getStaticUrls, sitemap.getDynamicUrls], function(err, urls) {
@ -94,7 +88,7 @@ var path = require('path'),
urls: urls urls: urls
}); });
returnSitemap(); sitemap.obj.toXML(callback);
}); });
} }
} }

Loading…
Cancel
Save