-
Notifications
You must be signed in to change notification settings - Fork 131
Closed as not planned
Closed as not planned
Copy link
Labels
[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Plugin] Regenerate Existing ImagesIssues for the Regenerate Existing Images moduleIssues for the Regenerate Existing Images module
Description
Create a new function and action that handles the HTTP request sent from the perflab_background_process_next_batch
. This will process the request and start the next batch run for the job ID passed.
Acceptance Criteria
- Create a custom function and register to the action
wp_ajax_background_process_next_batch
- The function accepts no parameters and takes data from the request
- The function will process the request as follows
- Verify the request by checking the key passed within the request data
- The key is checked against the value stored in the options table under
background_process_key_{$job_id}
- If the keys do not match, the action will return early
- The key is checked against the value stored in the options table under
- Verify the job is not currently running
- Take the
$job_id
from the HTTP request data - Using the job ID, check the
job_lock
term meta for this specific job - If the
job_lock
term meta is set, the job is running and the action will return early
- Take the
- If both checks above past, the job is run by calling the
perflab_background_process_run
function- The
perflab_background_process_run
is called passing the$job_id
as it's only parameter - The
background_process_key_{$job_id}
option is deleted from the option table
- The
- Verify the request by checking the key passed within the request data
Metadata
Metadata
Assignees
Labels
[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Plugin] Regenerate Existing ImagesIssues for the Regenerate Existing Images moduleIssues for the Regenerate Existing Images module