Skip to content

Commit

Permalink
Mark Cron transactions as background (non-web) (#827)
Browse files Browse the repository at this point in the history
* Mark Cron transactions as background (non-web)

Props @spacedmonkey
  • Loading branch information
simonwheatley authored Jan 30, 2018
1 parent 1ebdd40 commit d3ced78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vip-helpers/vip-newrelic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d3ced78

Please sign in to comment.