use of io.datarouter.tasktracker.service.LongRunningTaskTrackerFactory in project datarouter by hotpads.
the class JobWrapper method initTracker.
private static LongRunningTaskTracker initTracker(JobPackage jobPackage, String trackerName, Instant triggerTime, Instant scheduledTime, LongRunningTaskTrackerFactory longRunningTaskTrackerFactory, String triggeredBy) {
Instant deadline = Optional.ofNullable(jobPackage).flatMap(jp -> jp.getSoftDeadline(triggerTime)).orElse(null);
boolean warnOnReachingDeadline = Optional.ofNullable(jobPackage).flatMap(JobPackage::getWarnOnReachingDuration).orElse(false);
return longRunningTaskTrackerFactory.create(trackerName, LongRunningTaskType.JOB, deadline, warnOnReachingDeadline, triggeredBy).setTriggerTime(triggerTime).setScheduledTime(scheduledTime);
}
Aggregations