Collections functions
General functions
Render functions
Theme permission 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 241 to 254

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 25th May 2022 19:35 Europe/London time based on the source file dated 19th May 2022 17:05 Europe/London time.