0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Debug: Measure AMP parse (#9097)

no issue
This commit is contained in:
Katharina Irrgang 2017-10-04 11:32:00 +02:00 committed by Kevin Ansfield
parent d7e0770a7b
commit a36ca9c14e

View file

@ -120,7 +120,9 @@ function getAmperizeHTML(html, post) {
return;
}
var Amperize = require('amperize');
var Amperize = require('amperize'),
startedAtMoment = moment();
amperize = amperize || new Amperize();
// make relative URLs abolute
@ -129,6 +131,8 @@ function getAmperizeHTML(html, post) {
if (!amperizeCache[post.id] || moment(new Date(amperizeCache[post.id].updated_at)).diff(new Date(post.updated_at)) < 0) {
return new Promise(function (resolve) {
amperize.parse(html, function (err, res) {
logging.info('amp.parse', post.url, moment().diff(startedAtMoment, 'ms') + 'ms');
if (err) {
if (err.src) {
logging.error(new errors.GhostError({