WordPress at Your Fingertips
function is not described

ActionScheduler_DBStore::log_execution() public WC 1.0

Add execution message to action log.

{} It's a method of the class: ActionScheduler_DBStore{}

No Hooks.

Return

null. Nothing.

Usage

$ActionScheduler_DBStore = new ActionScheduler_DBStore();
$ActionScheduler_DBStore->log_execution( $action_id );
$action_id(int) (required)
Action ID.

Code of ActionScheduler_DBStore::log_execution() WC 6.1.1

public function log_execution( $action_id ) {
	/** @var \wpdb $wpdb */
	global $wpdb;

	$sql = "UPDATE {$wpdb->actionscheduler_actions} SET attempts = attempts+1, status=%s, last_attempt_gmt = %s, last_attempt_local = %s WHERE action_id = %d";
	$sql = $wpdb->prepare( $sql, self::STATUS_RUNNING, current_time( 'mysql', true ), current_time( 'mysql' ), $action_id ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
	$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}