mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
parent
d7e0770a7b
commit
a36ca9c14e
1 changed files with 5 additions and 1 deletions
|
@ -120,7 +120,9 @@ function getAmperizeHTML(html, post) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var Amperize = require('amperize');
|
var Amperize = require('amperize'),
|
||||||
|
startedAtMoment = moment();
|
||||||
|
|
||||||
amperize = amperize || new Amperize();
|
amperize = amperize || new Amperize();
|
||||||
|
|
||||||
// make relative URLs abolute
|
// 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) {
|
if (!amperizeCache[post.id] || moment(new Date(amperizeCache[post.id].updated_at)).diff(new Date(post.updated_at)) < 0) {
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
amperize.parse(html, function (err, res) {
|
amperize.parse(html, function (err, res) {
|
||||||
|
logging.info('amp.parse', post.url, moment().diff(startedAtMoment, 'ms') + 'ms');
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.src) {
|
if (err.src) {
|
||||||
logging.error(new errors.GhostError({
|
logging.error(new errors.GhostError({
|
||||||
|
|
Loading…
Add table
Reference in a new issue