scheduler/src/main/java/com/cognitree/kronos/scheduler/TaskProvider.java
/**
     * deletes all the stale tasks from graph having `createdAt` older than `durationInMillis`
     * </p>
     * before deleting a task we assure that the task is no longer required in future
     */
deletes all the stale tasks from graph having `createdAt` older than `durationInMillis`

before deleting a task we assure that the task is no longer required in future
deletes all the stale tasks from graph having ` createdAt ` older than ` durationInMillis ` before deleting a task we assure that the task is no longer required in future
synchronized void removeStaleTasks(long durationInMillis) {
        final Set<Task> tasksToDelete = new HashSet<>();
        Long cleanUpTimestamp = System.currentTimeMillis() - durationInMillis;
        for (Task task : graph.nodes()) {
            if (graph.inDegree(task) == 0) {
                tasksToDelete.addAll(getTasksToDelete(task, cleanUpTimestamp));
            }
        }
        logger.debug("Cleaning up tasks from memory {}", tasksToDelete);
        tasksToDelete.forEach(graph::removeNode);
    }
synchronized void removeStaleTasks ( long durationInMillis ) { final Set < Task > tasksToDelete = new HashSet < > ( ) ; Long cleanUpTimestamp = System . currentTimeMillis ( ) - durationInMillis ; for ( Task task : graph . nodes ( ) ) { if ( graph . inDegree ( task ) == 0 ) { tasksToDelete . addAll ( getTasksToDelete ( task , cleanUpTimestamp ) ) ; } } logger . debug ( "Cleaning up tasks from memory {}" , tasksToDelete ) ; tasksToDelete . forEach ( graph :: removeNode ) ; }
deletes all the stale tasks from graph having `createdAt` older than `durationInMillis`
 </p>
 before deleting a task we assure that the task is no longer required in future
deletes all the stale tasks from graph having ` createdAt ` older than ` durationInMillis ` < / p > before deleting a task we assure that the task is no longer required in future