code: public void rescheduleHungJobs() {
          try {
              //TODO 2779
              AgentInstances knownAgents = agentService.findRegisteredAgents();
              List<String> liveAgentIdList = getLiveAgentUuids(knownAgents);
              if (!liveAgentIdList.isEmpty()) {
                  JobInstances jobs = jobInstanceService.findHungJobs(liveAgentIdList);
                  for (JobInstance buildId : jobs) {
                      LOGGER.warn("Found hung job[id={}], rescheduling it", buildId);
                      rescheduleJob(buildId);
                  }
              }
          } catch (Exception e) {
              LOGGER.error("Error occured during reschedule hung builds: ", e);
          }
      }
docs: Note: This is called from a Spring timer