src/Tasks/DeleteAllJobsTask.php
public function run($request)
    {
        $confirm = $request->getVar('confirm');

        $jobs = DataObject::get(QueuedJobDescriptor::class);

        if (!$confirm) {
            echo "Really delete " . $jobs->count() . " jobs? Please add ?confirm=1 to the URL to confirm.";
            return;
        }

        echo "Deleting " . $jobs->count() . " jobs...<br>\n";
        $jobs->removeAll();
        echo "Done.";
    }
public function run($request)
    {
        $confirm = $request->getVar('confirm');

        $jobs = DataObject::get(QueuedJobDescriptor::class);

        if (!$confirm) {
            echo "Really delete " . $jobs->count() . " jobs? Please add ?confirm=1 to the URL to confirm.";
            return;
        }

        echo "Deleting " . $jobs->count() . " jobs...<br>\n";
        $jobs->removeAll();
        echo "Done.";
    }
Run the task
@param HTTPRequest $request