LUCEE - Clear all failed Tasks

Tuesday, March 21st, 2023 | Server
Last Modified: 2024-11-10



< 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>



Input Action Output
A collection of snippets and links that have proven useful for development and programming in ColdFusion, JavaScript, jQuery, PHP, Python, Dell, Minecraft, Apple, Mac, Windows, LINUX, Raspberry Pi, Adobe, CSS, and HTML.

©2024 Input Action Output