Search in sources :

Example 1 with ExecutionPlan

use of lucee.runtime.spooler.ExecutionPlan in project Lucee by lucee.

the class Admin method doGetRemoteClientTasks.

private int doGetRemoteClientTasks(lucee.runtime.type.Query qry, SpoolerTask[] tasks, int row) {
    SpoolerTask task;
    for (int i = 0; i < tasks.length; i++) {
        row++;
        task = tasks[i];
        try {
            qry.setAt("type", row, task.getType());
            qry.setAt("name", row, task.subject());
            qry.setAt("detail", row, task.detail());
            qry.setAt("id", row, task.getId());
            qry.setAt("lastExecution", row, new DateTimeImpl(pageContext, task.lastExecution(), true));
            qry.setAt("nextExecution", row, new DateTimeImpl(pageContext, task.nextExecution(), true));
            qry.setAt("closed", row, Caster.toBoolean(task.closed()));
            qry.setAt("tries", row, Caster.toDouble(task.tries()));
            qry.setAt("triesmax", row, Caster.toDouble(task.tries()));
            qry.setAt("exceptions", row, translateTime(task.getExceptions()));
            int triesMax = 0;
            ExecutionPlan[] plans = task.getPlans();
            for (int y = 0; y < plans.length; y++) {
                triesMax += plans[y].getTries();
            }
            qry.setAt("triesmax", row, Caster.toDouble(triesMax));
        } catch (Throwable t) {
            ExceptionUtil.rethrowIfNecessary(t);
        }
    }
    return row;
}
Also used : ExecutionPlan(lucee.runtime.spooler.ExecutionPlan) DateTimeImpl(lucee.runtime.type.dt.DateTimeImpl) SpoolerTask(lucee.runtime.spooler.SpoolerTask)

Aggregations

ExecutionPlan (lucee.runtime.spooler.ExecutionPlan)1 SpoolerTask (lucee.runtime.spooler.SpoolerTask)1 DateTimeImpl (lucee.runtime.type.dt.DateTimeImpl)1