Is there a way to bulk delete failed “Tasks” from ...
# lucee
j
Is there a way to bulk delete failed “Tasks” from the Lucee admin? I was unable to locate a spool file.
r
I don't believe there is a way to do that within Lucee Admin. However, you might be able to achieve a bulk delete of failed tasks using some code like the following.
Copy code
<cfscript>
    // Access the Task Scheduler
    taskService = createObject("component", "lucee.runtime.schedule.TaskService");

    // Get all tasks
    tasks = taskService.listAll();

    // Loop through tasks and delete failed tasks
    for (task in tasks) {
        if (task.status == "failed") {
            taskService.remove(task.id);
        }
    }
</cfscript>
🙌 1
🙌🏻 1
j
I’ll give it a shot. Thanks so much!
g
Isn’t there a delete all at the bottom ?
😳 1
j
I swear that was not there when I was looking. In too much of a rush. Doi! Thank you…