private void checkForDeadTask ( Tenant tenant , TaskRecord taskRecord ) { Calendar lastReport = taskRecord . getTime ( TaskRecord . PROP_PROGRESS_TIME ) ; if ( lastReport == null ) { lastReport = taskRecord . getTime ( TaskRecord . PROP_START_TIME ) ; if ( lastReport == null ) { return ; // corrupt/incomplete task record } } long minsSinceLastActivity = ( System . currentTimeMillis ( ) - lastReport . getTimeInMillis ( ) ) / ( 1000 * 60 ) ; if ( isOurActiveTask ( tenant , taskRecord . getTaskID ( ) ) ) { checkForHungTask ( tenant , taskRecord , minsSinceLastActivity ) ; } else { checkForAbandonedTask ( tenant , taskRecord , minsSinceLastActivity ) ; } }
See if the given in - progress task may be hung or abandoned .