Clarify that schedule config's startTime hour must be zero-padded

Configuring a startTime as "6:00" is incorrect; it should be "06:00".

Clarify this in the documentation and fix the Javadoc that shows an
incorrect value. Also add a test.

Change-Id: I8e72d42088163b6659204913e8b0685bd957c3d8
This commit is contained in:
David Pursehouse 2019-04-10 09:36:18 +09:00
parent d7a91bc30e
commit 18f388accc
3 changed files with 5 additions and 2 deletions

View File

@ -5064,7 +5064,7 @@ The placeholders can have the following values:
+ +
The time zone cannot be specified but is always the system default The time zone cannot be specified but is always the system default
time zone. time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
The section (and optionally the subsection) in which the `interval` and The section (and optionally the subsection) in which the `interval` and
`startTime` keys must be set depends on the background job for which a `startTime` keys must be set depends on the background job for which a

View File

@ -91,7 +91,7 @@ import org.eclipse.jgit.lib.Config;
* executions are {@code Wed 10:30}, {@code Fri 10:30}. etc. * executions are {@code Wed 10:30}, {@code Fri 10:30}. etc.
* <li> * <li>
* <pre> * <pre>
* foo.startTime = 6:00 * foo.startTime = 06:00
* foo.interval = 1 day * foo.interval = 1 day
* </pre> * </pre>
* Assuming that the server is started on {@code Mon 7:00} then this yields the first run on * Assuming that the server is started on {@code Mon 7:00} then this yields the first run on

View File

@ -202,6 +202,9 @@ public class ScheduleConfigTest {
rc.setString("a", null, ScheduleConfig.KEY_STARTTIME, "0100"); rc.setString("a", null, ScheduleConfig.KEY_STARTTIME, "0100");
assertThat(ScheduleConfig.builder(rc, "a").buildSchedule()).isEmpty(); assertThat(ScheduleConfig.builder(rc, "a").buildSchedule()).isEmpty();
rc.setString("a", null, ScheduleConfig.KEY_STARTTIME, "1:00");
assertThat(ScheduleConfig.builder(rc, "a").buildSchedule()).isEmpty();
} }
@Test @Test