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

Removed log line from AMP parsing

refs https://github.com/TryGhost/Ghost/pull/9097

- this was originally added to measure the AMP parsing time but AMP is
  becoming less and less important (it's disabled by default in Ghost
  now)
- this also causes a lot of noise when viewing logs, and I've never
  experienced an issue with AMP parsing time that we've needed to review
  these logs
- therefore, this commit deletes it
This commit is contained in:
Daniel Lockyer 2023-02-27 15:03:51 +01:00
parent 2e051fb271
commit 31bc57fbe1
No known key found for this signature in database

View file

@ -6,7 +6,7 @@
//
// Converts normal HTML into AMP HTML with Amperize module and uses a cache to return it from
// there if available. The cacheId is a combination of `updated_at` and the `slug`.
const {DateTime, Interval} = require('luxon');
const {DateTime} = require('luxon');
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
@ -120,8 +120,6 @@ function getAmperizeHTML(html, post) {
amperize = amperize || new Amperize();
const startedAtMoment = DateTime.now();
let cacheDateTime;
let postDateTime;
@ -136,8 +134,6 @@ function getAmperizeHTML(html, post) {
if (!amperizeCache[post.id] || cacheDateTime.diff(postDateTime).valueOf() < 0) {
return new Promise((resolve) => {
amperize.parse(html, (err, res) => {
logging.info('amp.parse', post.url, Interval.fromDateTimes(startedAtMoment, DateTime.now()).length('milliseconds') + 'ms');
if (err) {
if (err.src) {
// This is a valid 500 GhostError because it means the amperize parser is unable to handle some Ghost HTML.