Search in sources :

Example 1 with UpdateEfficiencyStatementsWorker

use of org.olat.course.assessment.manager.UpdateEfficiencyStatementsWorker in project OpenOLAT by OpenOLAT.

the class AssessmentModule method prepareUpdate.

private void prepareUpdate(Long resId) {
    boolean recalc = false;
    synchronized (upcomingWork) {
        // o_clusterOK by:ld synchronized OK - only one cluster node must update the EfficiencyStatements (the course is locked for editing) (same as e.g. file indexer)
        recalc = upcomingWork.contains(resId);
        if (recalc) {
            for (; upcomingWork.remove(resId); ) {
            // remove all with the same res id
            }
        }
    }
    if (recalc) {
        ICourse pubCourse = CourseFactory.loadCourse(resId);
        UpdateEfficiencyStatementsWorker worker = new UpdateEfficiencyStatementsWorker(pubCourse);
        taskExecutorManager.execute(worker);
    }
}
Also used : UpdateEfficiencyStatementsWorker(org.olat.course.assessment.manager.UpdateEfficiencyStatementsWorker) ICourse(org.olat.course.ICourse)

Example 2 with UpdateEfficiencyStatementsWorker

use of org.olat.course.assessment.manager.UpdateEfficiencyStatementsWorker in project openolat by klemens.

the class AssessmentModule method prepareUpdate.

private void prepareUpdate(Long resId) {
    boolean recalc = false;
    synchronized (upcomingWork) {
        // o_clusterOK by:ld synchronized OK - only one cluster node must update the EfficiencyStatements (the course is locked for editing) (same as e.g. file indexer)
        recalc = upcomingWork.contains(resId);
        if (recalc) {
            for (; upcomingWork.remove(resId); ) {
            // remove all with the same res id
            }
        }
    }
    if (recalc) {
        ICourse pubCourse = CourseFactory.loadCourse(resId);
        UpdateEfficiencyStatementsWorker worker = new UpdateEfficiencyStatementsWorker(pubCourse);
        taskExecutorManager.execute(worker);
    }
}
Also used : UpdateEfficiencyStatementsWorker(org.olat.course.assessment.manager.UpdateEfficiencyStatementsWorker) ICourse(org.olat.course.ICourse)

Aggregations

ICourse (org.olat.course.ICourse)2 UpdateEfficiencyStatementsWorker (org.olat.course.assessment.manager.UpdateEfficiencyStatementsWorker)2