·¸VƈàP“VƸP¼VƸP¼VÆJ“VÆJ“VÆØP¼VÆØP¼VÆàR¼VÆ è¸VÆÀ¸VÆàQ“VÆp“VÆ`R“VÆgÁзVÆ ^¼VÆÁ˸VÆè1±;ÈU@R¼VÆÀ“^ÈU@n8<ü±;ÈU¸X¼VÆÀ„Æ;ÈUÀX¼VÆàR¼VÆ X¼VÆЄÆ;ÈU°…Æ;ÈU …Æ;ÈUP…Æ;ÈU`…Æ;ÈUà…Æ;ÈUð…Æ;ÈU†Æ;ÈUp…Æ;ÈU€…Æ;ÈUà„Æ;ÈUð„Æ;ÈUÀ…Æ;ÈU…Æ;ÈUÐ…Æ;ÈU †Æ;ÈU…Æ;ÈU …Æ;ÈU…Æ;ÈU0…Æ;ÈU†Æ;ÈU@†Æ;ÈU0†Æ;ÈU †Æ;ÈU`†Æ;ÈUP†Æ;ÈU@…Æ;ÈU@±;ÈU`S´;ÈU H¬¸VƘX¼VÆp¬¸VÆÿÀ±;ÈUÀ±;ÈU 8±;ÈU(ÿÿÿÿÿÿÿÿô²;ÈU±;ÈUPÇÇ;ÈUØU¼VÆ€V¼VÆØU¼VÆÿÿÿÿÿÿÿÿ ¬¸VÆv±;ÈU°¦¸VÆXf”VưIP6àR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VÆàR¼VƸX¼VÆ?<üq?<üà?<üp¡¸VÆàR¼VÆÀX¼VÆ€^¼VÆ?<ü ?<ü0?<ü@?<üP?<üà?<ü€?<ü€?<üp?<ü`?<ü?<ü?<ü@?<üèX¼VÆx^¼VÆð­¸VÆx?<üˆ?<ü?<ü  Œ?<ü?<üÍ ?<üØU¼VƸ[¼VÆ`\¼VƸ[¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆÀX¼VÆq?<üd´»VÆ Z´»VÆ ð^¼VÆ_¼VÆ_¼VÆglibc-hwcaps/x86-64-v3/glibc-hwcaps/x86-64-v2/ ¸VÆP ¸VÆ  ¸VÆð ¸VÆfault) * 3. haven't exceeded the number of allowed batches. * * The order of these checks is important, because they run from a check on a value: * 1. in memory - is_admin() maps to $GLOBALS or the WP_ADMIN constant * 2. in memory - transients use autoloaded options by default * 3. from a database query - has_maximum_concurrent_batches() run the query * $this->store->get_claim_count() to find the current number of claims in the DB. * * If all of these conditions are met, then we request an async runner check whether it * should dispatch a request to process pending actions. */ public function maybe_dispatch_async_request() { if ( is_admin() && ! \ActionScheduler::lock()->is_locked( 'async-request-runner' ) ) { // Only start an async queue at most once every 60 seconds. \ActionScheduler::lock()->set( 'async-request-runner' ); $this->async_request->maybe_dispatch(); } } /** * Process actions in the queue. Attached to self::WP_CRON_HOOK i.e. 'action_scheduler_run_queue' * * The $context param of this method defaults to 'WP Cron', because prior to Action Scheduler 3.0.0 * that was the only context in which this method was run, and the self::WP_CRON_HOOK hook had no context * passed along with it. New code calling this method directly, or by triggering the self::WP_CRON_HOOK, * should set a context as the first parameter. For an example of this, refer to the code seen in * * @see ActionScheduler_AsyncRequest_QueueRunner::handle() * * @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron' * Generally, this should be capitalised and not localised as it's a proper noun. * * @return int */ public function run( $context = 'WP Cron' ) { \ActionScheduler_Compatibility::raise_memory_limit(); \ActionScheduler_Compatibility::raise_time_limit( $this->get_time_limit() ); do_action( 'action_scheduler_before_process_queue' );// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound $this->run_cleanup(); $processed_actions = 0; if ( false === $this->has_maximum_concurrent_batches() ) { $batch_size = apply_filters( 'action_scheduler_queue_runner_batch_size', 25 );// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound do { $processed_actions_in_batch = $this->do_batch( $batch_size, $context ); $processed_actions += $processed_actions_in_batch; } while ( $processed_actions_in_batch > 0 && ! $this->batch_limits_exceeded( $processed_actions ) ); // keep going until we run out of actions, time, or memory. } do_action( 'action_scheduler_after_process_queue' );// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound return $processed_actions; } /** * Process a batch of actions pending in the queue. * * Actions are processed by claiming a set of pending actions then processing each one until either the batch * size is completed, or memory or time limits are reached, defined by @see $this->batch_limits_exceeded(). * * @param int $size The maximum number of actions to process in the batch. * @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron' * Generally, this should be capitalised and not localised as it's a proper noun. * @return int The number of actions processed. */ protected function do_batch( $size = 100, $context = '' ) { try { $claim = $this->store->stake_claim( $size, null, [], $this->group ); $this->monitor->attach( $claim ); $processed_actions = 0; foreach ( $claim->get_actions() as $action_id ) { // bail if we lost the claim. if ( ! in_array( $action_id, $this->store->find_actions_by_claim_id( $claim->get_id() ), true ) ) { break; } $this->process_action( $action_id, $context ); ++$processed_actions; if ( $this->batch_limits_exceeded( $processed_actions ) ) { break; } } $this->store->release_claim( $claim ); $this->monitor->detach(); $this->clear_caches(); $this->reset_group(); return $processed_actions; } catch ( \Exception $exception ) { Logger::debug( $exception->getMessage() ); $this->reset_group(); return 0; } } /** * Reset group in store's claim filter. * * @return void */ private function reset_group() { if ( ! method_exists( $this->store, 'set_claim_filter' ) ) { return; } $this->store->set_claim_filter( 'group', '' ); } /** * Running large batches can eat up memory, as WP adds data to its object cache. * * If using a persistent object store, this has the side effect of flushing that * as well, so this is disabled by default. To enable: * * add_filter( 'action_scheduler_queue_runner_flush_cache', '__return_true' ); */ protected function clear_caches() { if ( ! wp_using_ext_object_cache() || apply_filters( 'action_scheduler_queue_runner_flush_cache', false ) ) {// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound wp_cache_flush(); } } /** * Add the cron schedule. * * @param array $schedules Array of current schedules. * * @return array */ public function add_wp_cron_schedule( $schedules ) { if ( isset( $schedules['every_minute'] ) ) { return $schedules; } $schedules['every_minute'] = [ 'interval' => 60, // in seconds. 'display' => __( 'Every minute', 'rocket' ), ]; return $schedules; } /** * Get the number of concurrent batches a runner allows. * * @return int */ public function get_allowed_concurrent_batches() { return 2; } }