diff --git a/core/src/main/java/hudson/scheduler/BaseParser.java b/core/src/main/java/hudson/scheduler/BaseParser.java index 9f0a8e22feed3d89fb1b3c42be06dc70ae497a0e..6f231401e796b4c86277362af95e8b68a5bdeb05 100644 --- a/core/src/main/java/hudson/scheduler/BaseParser.java +++ b/core/src/main/java/hudson/scheduler/BaseParser.java @@ -137,7 +137,6 @@ abstract class BaseParser extends LLkParser { /** * This property hashes tokens in the cron tab tokens like @daily so that they spread evenly. - * This is more aggressive optimization that changes the semantics, so not on by default. */ - public static boolean HASH_TOKENS = Boolean.getBoolean(BaseParser.class.getName()+".hash"); + public static boolean HASH_TOKENS = !"false".equals(System.getProperty(BaseParser.class.getName()+".hash")); } diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html index 488d6b0881d0ab8e8e8b6ad617070b823951a69c..83a42b02c05352facb496420f3555963e6eff271 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html @@ -58,6 +58,8 @@

In addition, '@yearly', '@annually', '@monthly', '@weekly', '@daily', '@midnight', and '@hourly' are supported. + These use the hash system for automatic balancing; for example '@hourly' could mean at any time during the hour. + '@midnight' actually means some time between 12:00 AM and 2:59 AM.

diff --git a/core/src/test/java/hudson/scheduler/CronTabTest.java b/core/src/test/java/hudson/scheduler/CronTabTest.java index 6df01e9bc8857bcfd45eea8f81bbc8903a9f34d0..15645c2a3ccc4f92fa4cfe3dfacc0fac7ac1137c 100644 --- a/core/src/test/java/hudson/scheduler/CronTabTest.java +++ b/core/src/test/java/hudson/scheduler/CronTabTest.java @@ -35,17 +35,12 @@ import org.jvnet.hudson.test.Bug; import org.jvnet.hudson.test.Url; import static java.util.Calendar.MONDAY; -import org.junit.BeforeClass; /** * @author Kohsuke Kawaguchi */ public class CronTabTest { - @BeforeClass public static void hashTokens() { - BaseParser.HASH_TOKENS = true; - } - @Test public void test1() throws ANTLRException { new CronTab("@yearly");