@Override public boolean allowConcurrentExecution(Map<String, List<ScheduledTask<?>>> activeTasks) { if (activeTasks.containsKey(ID)) { int activeRunningTasks = 0; for (ScheduledTask<?> scheduledTask : activeTasks.get(ID)) { if (RUNNING.equals(scheduledTask.getTaskState())) { if (conflictsWith((GenerateMetadataTask) scheduledTask.getTask())) { return false; } activeRunningTasks++; } } return activeRunningTasks < yumRegistry.maxNumberOfParallelThreads(); } return true; }
/** {@inheritDoc} */ @Override @NotNull public String getTimeout() { if (!(DONE.equals(status) || RUNNING.equals(status))) { return TIMER_STUB; } RunnerMetric timeoutMetric = getRunnerMetricByName(RunnerMetric.TERMINATION_TIME); if (timeoutMetric != null) { return getTimeOut(timeoutMetric); } RunnerMetric lifeTimeMetric = getRunnerMetricByName(RunnerMetric.LIFETIME); if (lifeTimeMetric != null && NEW.equals(descriptor.getStatus())) { return getLifeTime(lifeTimeMetric); } return TIMER_STUB; }