}
// Now let's fetch the first action (having the same hook) of *any status* within the same window.
unset( $query_args['status'] );
$first_action_id_with_the_same_hook = $this->store->query_actions( $query_args );
return (bool) apply_filters(
'action_scheduler_recurring_action_is_consistently_failing',
$first_action_id_with_the_same_hook === $first_failing_action_id,
$action
);
}
protected function run_cleanup() {
$this->cleaner->clean( 10 * $this->get_time_limit() );
}
public function get_allowed_concurrent_batches() {
return apply_filters( 'action_scheduler_queue_runner_concurrent_batches', 1 );
}
public function has_maximum_concurrent_batches() {
return $this->store->get_claim_count() >= $this->get_allowed_concurrent_batches();
}
protected function get_time_limit() {
$time_limit = 30;
// Apply deprecated filter from deprecated get_maximum_execution_time() method
if ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {
_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );
$time_limit = apply_filters( 'action_scheduler_maximum_execution_time', $time_limit );
}
return absint( apply_filters( 'action_scheduler_queue_runner_time_limit', $time_limit ) );
}
protected function get_execution_time() {
$execution_time = microtime( true ) - $this->created_time;
// Get the CPU time if the hosting environment uses it rather than wall-clock time to calculate a process's execution time.
if ( function_exists( 'getrusage' ) && apply_filters( 'action_scheduler_use_cpu_execution_time', defined( 'PANTHEON_ENVIRONMENT' ) ) ) {
$resource_usages = getrusage();
if ( isset( $resource_usages['ru_stime.tv_usec'], $resource_usages['ru_stime.tv_usec'] ) ) {
$execution_time = $resource_usages['ru_stime.tv_sec'] + ( $resource_usages['ru_stime.tv_usec'] / 1000000 );
}
}
return $execution_time;
}
protected function time_likely_to_be_exceeded( $processed_actions ) {
$execution_time = $this->get_execution_time();
$max_execution_time = $this->get_time_limit();
// Safety against division by zero errors.
if ( 0 === $processed_actions ) {
return $execution_time >= $max_execution_time;
}
$time_per_action = $execution_time / $processed_actions;
$estimated_time = $execution_time + ( $time_per_action * 3 );
$likely_to_be_exceeded = $estimated_time > $max_execution_time;
return apply_filters( 'action_scheduler_maximum_execution_time_likely_to_be_exceeded', $likely_to_be_exceeded, $this, $processed_actions, $execution_time, $max_execution_time );
}
protected function get_memory_limit() {
if ( function_exists( 'ini_get' ) ) {
$memory_limit = ini_get( 'memory_limit' );
} else {
$memory_limit = '128M'; // Sensible default, and minimum required by WooCommerce
}
if ( ! $memory_limit || -1 === $memory_limit || '-1' === $memory_limit ) {
// Unlimited, set to 32GB.
$memory_limit = '32G';
}
return ActionScheduler_Compatibility::convert_hr_to_bytes( $memory_limit );
}
protected function memory_exceeded() {
$memory_limit = $this->get_memory_limit() * 0.90;
$current_memory = memory_get_usage( true );
$memory_exceeded = $current_memory >= $memory_limit;
return apply_filters( 'action_scheduler_memory_exceeded', $memory_exceeded, $this );
}
protected function batch_limits_exceeded( $processed_actions ) {
return $this->memory_exceeded() || $this->time_likely_to_be_exceeded( $processed_actions );
}
abstract public function run( $context = '' );
}
Fatal error: Uncaught Error: Class "ActionScheduler_Abstract_QueueRunner" not found in /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php:3
Stack trace:
#0 /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php(91): include()
#1 /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php(25): ActionScheduler::autoload('ActionScheduler...')
#2 /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php(103): ActionScheduler::runner()
#3 /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/action-scheduler.php(21): ActionScheduler::init('/htdocs/wp-cont...')
#4 /htdocs/wp-content/plugins/all-in-one-seo-pack/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php(59): action_scheduler_initialize_3_dot_8_dot_0()
#5 /htdocs/wp-includes/class-wp-hook.php(322): ActionScheduler_Versions::initialize_latest_version()
#6 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#7 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /htdocs/wp-settings.php(559): do_action('plugins_loaded')
#9 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...')
#10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...')
#11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...')
#12 /htdocs/index.php(17): require('/htdocs/wp-blog...')
#13 {main}
thrown in /htdocs/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php on line 3