Automattic\WooCommerce\Internal\VariationGallery
Package::has_pending_or_running_migration
Determine whether the migration is already pending or running.
Method of the class: Package{}
No Hooks.
Returns
true|false.
Usage
$result = Package::has_pending_or_running_migration( $args ): bool;
- $args(array) (required)
- .
Package::has_pending_or_running_migration() Package::has pending or running migration code WC 10.9.4
private static function has_pending_or_running_migration( array $args ): bool {
if ( null !== WC()->queue()->get_next( self::UPDATE_CALLBACK_HOOK, $args, self::UPDATE_CALLBACK_GROUP ) ) {
return true;
}
$running_actions = WC()->queue()->search(
array(
'hook' => self::UPDATE_CALLBACK_HOOK,
'args' => $args,
'status' => \ActionScheduler_Store::STATUS_RUNNING,
'per_page' => 1,
'group' => self::UPDATE_CALLBACK_GROUP,
),
'ids'
);
return ! empty( $running_actions );
}