use of org.gradle.launcher.daemon.registry.DaemonInfo in project gradle by gradle.
the class NotMostRecentlyUsedDaemonExpirationStrategy method isMostRecentlyUsed.
private boolean isMostRecentlyUsed(Collection<DaemonInfo> daemonInfos, DaemonContext thisDaemonContext) {
String mruUid = null;
Date mruTimestamp = new Date(Long.MIN_VALUE);
for (DaemonInfo daemonInfo : daemonInfos) {
Date daemonAccessTime = daemonInfo.getLastBusy();
if (daemonAccessTime.after(mruTimestamp)) {
mruUid = daemonInfo.getUid();
mruTimestamp = daemonAccessTime;
}
}
return thisDaemonContext.getUid().equals(mruUid);
}
Aggregations