Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

job_queue_purge()

Description

Delete all jobs in the specified state

Parameters

ColumnTypeDefaultDescription
$status int 0 to purge, whole queue will be purged if not set

Return

void

Location

include/job_functions.php lines 240 to 253

Definition

 
function job_queue_purge($status=0)
    {
    
$deletejobs job_queue_get_jobs('',$status == '' $status);
    if(
count($deletejobs) > 0)
        {
        
$deletejobs_sql job_queue_get_jobs('',$status == '' $status,"","","priority","asc","",true);
        
ps_query(
            
"DELETE FROM job_queue 
                WHERE ref IN 
                    (SELECT jobs.ref FROM 
                        ( " 
$deletejobs_sql->sql ") AS jobs)"
            
,$deletejobs_sql->parameters);
        }
    }

This article was last updated 21st May 2024 21:35 Europe/London time based on the source file dated 23rd February 2024 17:00 Europe/London time.