From d3ced784c419d1509dae863a0aa104657f5a72fe Mon Sep 17 00:00:00 2001 From: Simon Wheatley Date: Tue, 30 Jan 2018 12:30:57 +0000 Subject: [PATCH] Mark Cron transactions as background (non-web) (#827) * Mark Cron transactions as background (non-web) Props @spacedmonkey --- vip-helpers/vip-newrelic.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vip-helpers/vip-newrelic.php b/vip-helpers/vip-newrelic.php index 5b8735bf44..f0f79f718d 100644 --- a/vip-helpers/vip-newrelic.php +++ b/vip-helpers/vip-newrelic.php @@ -57,10 +57,12 @@ function wpcom_vip_add_uri_to_newrelic() { */ function wpcom_vip_cron_for_newrelic() { if ( wp_doing_cron() + && function_exists( 'newrelic_name_transaction' ) + && function_exists( 'newrelic_background_job' ) && function_exists( 'newrelic_ignore_apdex' ) - && function_exists( 'newrelic_add_custom_parameter' ) - && function_exists( 'newrelic_name_transaction' ) ) { + ) { newrelic_name_transaction( 'wp-cron' ); + newrelic_background_job( true); // N.B. VIP Go sites execute cron events through WP CLI, so the event // can be determined in the New Relic 'wp-cli-cmd-args' custom parameter newrelic_ignore_apdex();