提交 3e71c976 编写于 作者: J Jesse Glick

hudson.scheduler.BaseParser.hash=true by default: @daily should not necessarily mean 12:00 AM.

上级 67c0edd0
......@@ -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"));
}
......@@ -58,6 +58,8 @@
</p><p>
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.
</p>
<table>
<tr>
......
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册