提交 7060c5ff 编写于 作者: S stephenconnolly

Better idle and in demand detection

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9444 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8c2eb94b
......@@ -149,12 +149,12 @@ public abstract class RetentionStrategy<T extends Computer> implements Describab
public synchronized long check(SlaveComputer c) {
if (c.isOffline()) {
final Queue queue = Hudson.getInstance().getQueue();
final Queue.Item[] items = queue.getItems(); // TODO filter this array to this computer
for (Queue.Item item : items) {
if ((System.currentTimeMillis() - item.timestamp.getTimeInMillis()) >
for (Queue.Item item : queue.getBuildableItems(c)) {
if ((System.currentTimeMillis() - item.buildableStartMilliseconds) >
TimeUnit.MILLISECONDS.convert(inDemandDelay, TimeUnit.MINUTES)) {
// we've been in demand for long enough
logger.log(Level.INFO, "Trying to launch computer {0} as it has been in demand for too long", c.getNode().getNodeName());
logger.log(Level.INFO, "Trying to launch computer {0} as it has been in demand for too long",
c.getNode().getNodeName());
if (c.isOffline() && c.isLaunchSupported())
c.tryReconnect();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册