void handleUnknownTasks ( List < TaskRec > taskRecList ) { long nowMs = System . currentTimeMillis ( ) ; for ( TaskRec taskRec : taskRecList ) { if ( taskRec . createTs . getTime ( ) < nowMs - UNKNOWN_TASK_CANCEL_AFTER_MS ) { logger . warn ( "Task is unknown and was not processed during 24 hours, mark as error: {}" , taskRec ) ; changeTaskStatus ( taskRec . taskId , TedStatus . ERROR , "unknown task" ) ; } else { logger . warn ( "Task is unknown, mark as new, postpone: {}" , taskRec ) ; changeTaskStatusPostponed ( taskRec . taskId , TedStatus . NEW , "unknown task. postpone" , new Date ( nowMs + UNKNOWN_TASK_POSTPONE_MS ) ) ; } } }
can be called from eventQueue also