-
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 the remaining job functions needed to handle jobs correctly within the background process.
Acceptance Criteria
Create a new perflab_update_background_job
function
- Function accepts the following parameters
$job_id
- Required. An integer of the job ID to update.$job_data
- Optional. An array of the job data to update, defaults to an empty array.
- The job term is updated using
update_term_meta
function. - The
job_data
term meta is replaced entirely by the new$job_data
array passed.
Create a new perflab_complete_background_job
- Function accepts the following parameters
$job_id
- Required. An integer of the job ID to update.
- The function will use the
$job_id
to update the following term metajob_completed_at
- Set the term meta to the current timestampjob_status
- Set the term meta to the stringcompleted
.
Create a new perflab_background_job_error
- Function accepts the following parameters
$job_id
- Required. An integer of the job ID to update.$message
- Required. A string containing the error message.$error_data
- Optional. An array of additional data to store for debugging. Defaults to an empty array.
- The function will use the job ID to update the following term meta.
job_errors
- Thejob_errors
array will be updated by appending the new error. Each error stored in the array is an another array containing the following keys:datetime
- The datetime string when the error message was created. formatYYYY-MM-DD HH:MM:SS
message
- The error message from the$message
parameterdata
- The$error_data
array passed.
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