public IdleOfflineCause () { super(hudson.slaves.Messages._RetentionStrategy_Demand_OfflineIdle()); } }
public IdleOfflineCause () { super(hudson.slaves.Messages._RetentionStrategy_Demand_OfflineIdle()); } }
public synchronized long check(SlaveComputer c) { if (c.isOffline()) { final long demandMilliseconds = System.currentTimeMillis() - c.getDemandStartMilliseconds(); if (demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/ && c.isLaunchSupported()) { // we've been in demand for long enough logger.log(Level.INFO, "Launching computer {0} as it has been in demand for {1}", new Object[]{c.getName(), Util.getTimeSpanString(demandMilliseconds)}); c.connect(false); } } else if (c.isIdle()) { final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds(); if (idleMilliseconds > idleDelay * 1000 * 60 /*MINS->MILLIS*/) { // we've been idle for long enough logger.log(Level.INFO, "Disconnecting computer {0} as it has been idle for {1}", new Object[]{c.getName(), Util.getTimeSpanString(idleMilliseconds)}); c.disconnect(OfflineCause.create(Messages._RetentionStrategy_Demand_OfflineIdle())); } } return 1; }
public synchronized long check(SlaveComputer c) { if (c.isOffline()) { final long demandMilliseconds = System.currentTimeMillis() - c.getDemandStartMilliseconds(); if (demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/ && c.isLaunchSupported()) { // we've been in demand for long enough logger.log(Level.INFO, "Launching computer {0} as it has been in demand for {1}", new Object[]{c.getName(), Util.getTimeSpanString(demandMilliseconds)}); c.connect(false); } } else if (c.isIdle()) { final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds(); if (idleMilliseconds > idleDelay * 1000 * 60 /*MINS->MILLIS*/) { // we've been idle for long enough logger.log(Level.INFO, "Disconnecting computer {0} as it has been idle for {1}", new Object[]{c.getName(), Util.getTimeSpanString(idleMilliseconds)}); c.disconnect(OfflineCause.create(Messages._RetentionStrategy_Demand_OfflineIdle())); } } return 1; }
public synchronized long check(SlaveComputer c) { if (c.isOffline()) { final long demandMilliseconds = System.currentTimeMillis() - c.getDemandStartMilliseconds(); if (demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/ && c.isLaunchSupported()) { // we've been in demand for long enough logger.log(Level.INFO, "Launching computer {0} as it has been in demand for {1}", new Object[]{c.getName(), Util.getTimeSpanString(demandMilliseconds)}); c.connect(false); } } else if (c.isIdle()) { final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds(); if (idleMilliseconds > idleDelay * 1000 * 60 /*MINS->MILLIS*/) { // we've been idle for long enough logger.log(Level.INFO, "Disconnecting computer {0} as it has been idle for {1}", new Object[]{c.getName(), Util.getTimeSpanString(idleMilliseconds)}); c.disconnect(OfflineCause.create(Messages._RetentionStrategy_Demand_OfflineIdle())); } } return 1; }
public synchronized long check(SlaveComputer c) { if (c.isOffline()) { final long demandMilliseconds = System.currentTimeMillis() - c.getDemandStartMilliseconds(); if (demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/ && c.isLaunchSupported()) { // we've been in demand for long enough logger.log(Level.INFO, "Launching computer {0} as it has been in demand for {1}", new Object[]{c.getName(), Util.getTimeSpanString(demandMilliseconds)}); c.connect(false); } } else if (c.isIdle()) { final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds(); if (idleMilliseconds > idleDelay * 1000 * 60 /*MINS->MILLIS*/) { // we've been idle for long enough logger.log(Level.INFO, "Disconnecting computer {0} as it has been idle for {1}", new Object[]{c.getName(), Util.getTimeSpanString(idleMilliseconds)}); c.disconnect(OfflineCause.create(Messages._RetentionStrategy_Demand_OfflineIdle())); } } return 1; }