Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer schedule increment value 0 #148

Open
chengfang opened this issue Apr 7, 2023 · 1 comment
Open

Timer schedule increment value 0 #148

chengfang opened this issue Apr 7, 2023 · 1 comment

Comments

@chengfang
Copy link
Contributor

This timer service section states that:

For an expression x/y, the attribute is constrained to every yth value within the set of allowable values beginning at time x. The x value is inclusive. The wildcard character (*) can be used in the x position, and is equivalent to 0. Increments are only supported within the second, minute, and hour attributes. For the second and minute attributes, x and y must each be in the range [0,59]. For the hour attribute, x and y must each be in the range [0,23].

Given the value range of [0, 59], 0 increment value as in second="10/0" fall into the valid range, though 0 increment value doesn't seem right. What's the expected behavior here?

Shall we consider "10/0" as equivalent to a single-value "10", or consider it invalid?

@tkburroughs
Copy link
Member

Since the specification does state 0 is a valid value, I believe "10/0" should be valid. Looking at this example from the specification:

Example: Every 10 seconds within the minute, starting at second 30
second = "30/10"
The following is equivalent:
second = "30,40,50"

The value "30" being the initial value, and then incrementing "10" would result in the 40 and 50 values. It would seem the only way to treat "30/0" as valid would be to have the initial value of "30", and then the "0" would result in no increment, so the equivalent to "30/0" would be just "30"... as you suggest. Thus, the specification could provide an example like this:

Example: Every 0 seconds within the minute, starting at second 30
second = "30/0"
The following is equivalent:
second = "30"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants