Skip to content

Create Background Processing Infrastructure: Create perflab_start_background_job #480

@mxbclang

Description

@mxbclang

Create a new perflab_start_background_job() function to start the background process for a specific job ID by making a HTTP POST request to the admin-ajax.php endpoint.

Acceptance Criteria

  • Function accepts the following parameters
    • $job_id - A integer that is the ID for a job returned by the perflab_create_background_job function
  • The function will make a HTTP request to the admin-ajax.php endpoint with the wp_remote_post along with the following parameters
    • action: wp_ajax_background_process_handle_request
    • nonce: wp_create_nonce( 'wp_ajax_background_process_handle_request' )
    • timeout: 0.1
    • data: array( $job_id )
    • blocking: false
    • sslverify: apply_filters( 'https_local_ssl_verify', false )
  • The function will return the following depending on success or failure
    • On failure the function returns the WP_Error from wp_remote_post
    • On success, the function returns true

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions