提交 995ca238 编写于 作者: K kohsuke

simplified by using a convenience method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9401 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c30c3a80
package hudson.slaves;
import hudson.model.Slave;
import hudson.model.Hudson;
import hudson.model.Queue;
import hudson.model.Executor;
import hudson.model.Slave;
import hudson.triggers.SafeTimerTask;
import java.util.Map;
......@@ -25,13 +24,8 @@ public class SlaveReconnectionWork extends SafeTimerTask {
for (Slave s : Hudson.getInstance().getSlaves()) {
if (!nextCheck.containsKey(s) || System.currentTimeMillis() > nextCheck.get(s)) {
boolean hasJob = false;
for (Executor exec: s.getComputer().getExecutors()) {
if (!exec.isIdle()) {
hasJob = true;
break;
}
}
boolean hasJob = !s.getComputer().isIdle();
// TODO get only the items from the queue that can apply to this slave
SlaveAvailabilityStrategy.State state = new SlaveAvailabilityStrategy.State(queue.getItems().length > 0, hasJob);
// at the moment I don't trust strategies to wait more than 60 minutes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册