Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #345 from alleyinteractive/feature/coral-cron
Browse files Browse the repository at this point in the history
Update frequency of Coral comment count cron to every 5 minutes
  • Loading branch information
amyevans authored Jul 30, 2021
2 parents cf2c78b + 98524ec commit b721eeb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inc/integrations/class-coral.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,15 @@ public function cron_exec( $limit = 25 ) {

// Update the time for the current cron run.
update_option( $this->cron_timestamp_key, time() );

// Remove the existing scheduled job if necessary.
$timestamp = wp_next_scheduled( $this->comment_count_cron_hook );
if ( $timestamp ) {
wp_unschedule_event( $timestamp, $this->comment_count_cron_hook );
}

// Schedule the next cron job for 5 minutes from now.
wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, $this->comment_count_cron_hook );
}

/**
Expand Down

0 comments on commit b721eeb

Please sign in to comment.