本文整理了Java中hudson.slaves.AbstractCloudComputer.isIdle()
方法的一些代码示例,展示了AbstractCloudComputer.isIdle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractCloudComputer.isIdle()
方法的具体详情如下:
包路径:hudson.slaves.AbstractCloudComputer
类名称:AbstractCloudComputer
方法名:isIdle
暂无
代码示例来源:origin: jenkinsci/jenkins
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
final AbstractCloudSlave computerNode = c.getNode();
if (c.isIdle() && !disabled && computerNode != null) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
try {
computerNode.terminate();
} catch (InterruptedException | IOException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
}
}
}
return 1;
}
代码示例来源:origin: KostyaSha/yet-another-docker-plugin
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer acc) {
// When the slave is idle we should disable accepting tasks and check to see if it is already trying to
// terminate. If it's not already trying to terminate then lets terminate manually.
if (acc.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - acc.getIdleStartMilliseconds();
if (idleMilliseconds > TimeUnit2.MINUTES.toMillis(idleMinutes)) {
LOG.debug("Disconnecting {}", acc.getName());
done(acc);
}
}
// Return one because we want to check every minute if idle.
return 1;
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
final AbstractCloudSlave computerNode = c.getNode();
if (c.isIdle() && !disabled && computerNode != null) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
try {
computerNode.terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
} catch (IOException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
}
}
}
return 1;
}
代码示例来源:origin: hudson/hudson-2.x
public synchronized long check(AbstractCloudComputer c) {
if (c.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.info("Disconnecting "+c.getName());
try {
c.getNode().terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
} catch (IOException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
}
}
}
return 1;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public synchronized long check(AbstractCloudComputer c) {
if (c.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.info("Disconnecting "+c.getName());
try {
c.getNode().terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
} catch (IOException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
}
}
}
return 1;
}
代码示例来源:origin: KostyaSha/yet-another-docker-plugin
/**
* While x-stream serialisation buggy, copy implementation.
*/
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
final AbstractCloudSlave computerNode = c.getNode();
if (c.isIdle() && computerNode != null) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOG.info("Disconnecting {}, after {} min timeout.", c.getName(), idleMinutes);
try {
computerNode.terminate();
} catch (InterruptedException | IOException e) {
LOG.warn("Failed to terminate {}", c.getName(), e);
}
}
}
return 1;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public synchronized long check(AbstractCloudComputer c) {
if (c.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.info("Disconnecting "+c.getName());
try {
c.getNode().terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
} catch (IOException e) {
LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
}
}
}
return 1;
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public synchronized long check(AbstractCloudComputer c) {
if (c.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
LOGGER.info("Disconnecting " + c.getName());
try {
c.getNode().terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
} catch (IOException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
}
}
}
return 1;
}
内容来源于网络,如有侵权,请联系作者删除!