Skip to content

Commit

Permalink
added a hook to disable the check during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed May 23, 2009
1 parent e957a10 commit a1f2c31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/ec2/EC2RetentionStrategy.java
Expand Up @@ -18,7 +18,7 @@ public EC2RetentionStrategy() {
}

public synchronized long check(EC2Computer c) {
if (c.isIdle()) {
if (c.isIdle() && !disabled) {
// TODO: really think about the right strategy here
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
if (idleMilliseconds > TimeUnit2.MINUTES.toMillis(30)) {
Expand Down Expand Up @@ -46,4 +46,6 @@ public String getDisplayName() {
}

private static final Logger LOGGER = Logger.getLogger(EC2RetentionStrategy.class.getName());

public static boolean disabled = Boolean.getBoolean(EC2RetentionStrategy.class.getName()+".disabled");
}

0 comments on commit a1f2c31

Please sign in to comment.