scheduler/src/main/java/com/cognitree/kronos/scheduler/TaskSchedulerService.java
/**
     * submit tasks ready for execution to queue
     */
submit tasks ready for execution to queue
submit tasks ready for execution to queue
private synchronized void scheduleReadyTasks() {
        final List<Task> readyTasks = taskProvider.getReadyTasks();
        for (Task task : readyTasks) {
            logger.info("Scheduling task {} for execution", task);
            try {
                if (task.getStatus() != UP_FOR_RETRY) {
                    updateTaskProperties(task);
                }
                QueueService.getService(SCHEDULER_QUEUE).send(task);
                updateStatus(task.getIdentity(), SCHEDULED, null);
            } catch (ServiceException e) {
                logger.error("Error scheduling task {} for execution", task.getIdentity(), e);
                updateStatus(task.getIdentity(), FAILED, TASK_SCHEDULING_FAILED_MESSAGE);
            }
        }
    }
private synchronized void scheduleReadyTasks ( ) { final List < Task > readyTasks = taskProvider . getReadyTasks ( ) ; for ( Task task : readyTasks ) { logger . info ( "Scheduling task {} for execution" , task ) ; try { if ( task . getStatus ( ) != UP_FOR_RETRY ) { updateTaskProperties ( task ) ; } QueueService . getService ( SCHEDULER_QUEUE ) . send ( task ) ; updateStatus ( task . getIdentity ( ) , SCHEDULED , null ) ; } catch ( ServiceException e ) { logger . error ( "Error scheduling task {} for execution" , task . getIdentity ( ) , e ) ; updateStatus ( task . getIdentity ( ) , FAILED , TASK_SCHEDULING_FAILED_MESSAGE ) ; } } }
submit tasks ready for execution to queue
submit tasks ready for execution to queue
// update dynamic task properties from the tasks it depends on before scheduling // only if the task is not being retried