Search in sources :

Example 1 with RunTaskOnceException

use of com.haulmont.cuba.core.global.RunTaskOnceException in project cuba by cuba-platform.

the class Scheduling method runOnce.

@Override
public void runOnce(ScheduledTask task) {
    UserSession userSession;
    try {
        userSession = getUserSession(task);
    } catch (LoginException e) {
        throw new RuntimeException("Unable to obtain user session", e);
    }
    Integer priority = getServerPriority(task, serverInfo.getServerId());
    if (priority == null) {
        throw new RunTaskOnceException(task.toString());
    }
    lastStartCache.put(task, timeSource.currentTimeMillis());
    runner.runTaskOnce(task, timeSource.currentTimeMillis(), userSession);
}
Also used : RunTaskOnceException(com.haulmont.cuba.core.global.RunTaskOnceException) UserSession(com.haulmont.cuba.security.global.UserSession) LoginException(com.haulmont.cuba.security.global.LoginException)

Aggregations

RunTaskOnceException (com.haulmont.cuba.core.global.RunTaskOnceException)1 LoginException (com.haulmont.cuba.security.global.LoginException)1 UserSession (com.haulmont.cuba.security.global.UserSession)1