• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / ActionScheduler_WPCLI_QueueRunner::run() – Process actions in the queue.

You appear to be a bot. Output may be restricted

Description

Process actions in the queue.

Usage

$int = ActionScheduler_WPCLI_QueueRunner::run( $context );

Parameters

$context
( string ) optional default: WP CLI – Optional runner context. Default 'WP CLI'.

Returns

int The number of actions processed.

Source

File name: woocommerce/packages/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php


Lines:

1 to 22 of 22
  public function run( $context = 'WP CLI' ) {
    do_action( 'action_scheduler_before_process_queue' );
    $this->setup_progress_bar();
    foreach ( $this->actions as $action_id ) {
      // Error if we lost the claim.
      if ( ! in_array( $action_id, $this->store->find_actions_by_claim_id( $this->claim->get_id() ) ) ) {
        WP_CLI::warning( __( 'The claim has been lost. Aborting current batch.', 'woocommerce' ) );
        break;
      }

      $this->process_action( $action_id, $context );
      $this->progress_bar->tick();
    }

    $completed = $this->progress_bar->current();
    $this->progress_bar->finish();
    $this->store->release_claim( $this->claim );
    do_action( 'action_scheduler_after_process_queue' );

    return $completed;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 6th April 2020

Primary Sidebar

Information

Function name: ActionScheduler_WPCLI_QueueRunner::run
Class ref: ActionScheduler_WPCLI_QueueRunner
Plugin ref: WooCommerce
Version: 5.2.2
Sourcefile: packages/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php
File ref: packages/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php
Deprecated?: No
API Letters: A,Q,R,W

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.7.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites