Action_Scheduler\Migration

Scheduler::schedule_migration()publicWC 1.0

Schedule the migration.

Method of the class: Scheduler{}

No Hooks.

Return

String. The action ID

Usage

$Scheduler = new Scheduler();
$Scheduler->schedule_migration( $when );
$when(int)
Optional timestamp to run the next migration batch.
Default: now

Scheduler::schedule_migration() code WC 8.7.0

public function schedule_migration( $when = 0 ) {
	$next = as_next_scheduled_action( self::HOOK );

	if ( ! empty( $next ) ) {
		return $next;
	}

	if ( empty( $when ) ) {
		$when = time() + MINUTE_IN_SECONDS;
	}

	return as_schedule_single_action( $when, self::HOOK, array(), self::GROUP );
}