use of org.olat.core.commons.services.taskexecutor.Sequential in project OpenOLAT by OpenOLAT.
the class TaskExecutorManagerImpl method execute.
@Override
public void execute(Runnable task) {
// wrap call to the task here to catch all errors that are may not catched yet in the task itself
// like outOfMemory or other system errors.
Task persistentTask = null;
if (task instanceof LongRunnable) {
persistentTask = persistentTaskDao.createTask(UUID.randomUUID().toString(), (LongRunnable) task);
dbInstance.commit();
} else {
execute(task, persistentTask, (task instanceof Sequential));
}
}
use of org.olat.core.commons.services.taskexecutor.Sequential in project OpenOLAT by OpenOLAT.
the class TaskExecutorManagerImpl method processTaskToDo.
protected void processTaskToDo() {
try {
List<Long> todos = persistentTaskDao.tasksToDo();
for (Long todo : todos) {
PersistentTask task = persistentTaskDao.loadTaskById(todo);
Runnable runnable = persistentTaskDao.deserializeTask(task);
PersistentTaskRunnable command = new PersistentTaskRunnable(todo);
execute(command, null, (runnable instanceof Sequential));
}
} catch (Exception e) {
// ups, something went completely wrong! We log this but continue next time
log.error("Error while executing task todo", e);
}
}
use of org.olat.core.commons.services.taskexecutor.Sequential in project openolat by klemens.
the class TaskExecutorManagerImpl method execute.
@Override
public void execute(Runnable task) {
// wrap call to the task here to catch all errors that are may not catched yet in the task itself
// like outOfMemory or other system errors.
Task persistentTask = null;
if (task instanceof LongRunnable) {
persistentTask = persistentTaskDao.createTask(UUID.randomUUID().toString(), (LongRunnable) task);
dbInstance.commit();
} else {
execute(task, persistentTask, (task instanceof Sequential));
}
}
use of org.olat.core.commons.services.taskexecutor.Sequential in project openolat by klemens.
the class TaskExecutorManagerImpl method processTaskToDo.
protected void processTaskToDo() {
try {
List<Long> todos = persistentTaskDao.tasksToDo();
for (Long todo : todos) {
PersistentTask task = persistentTaskDao.loadTaskById(todo);
Runnable runnable = persistentTaskDao.deserializeTask(task);
PersistentTaskRunnable command = new PersistentTaskRunnable(todo);
execute(command, null, (runnable instanceof Sequential));
}
} catch (Exception e) {
// ups, something went completely wrong! We log this but continue next time
log.error("Error while executing task todo", e);
}
}
Aggregations