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

--excluded-times-of-day ignored the seconds, which causes unexpected killing #178

Open
tonyairwallex opened this issue Feb 18, 2020 · 4 comments

Comments

@tonyairwallex
Copy link

tonyairwallex commented Feb 18, 2020

I set the excluded time as:
0:00-13:59,16:00-23:59
and triggered the execution.

Expected result:
Run during 14:00:00 to 15:59:59
(Should exclude 16:00:00 to 23:59:59 rather than 23:59:00)

Actual result:
Killing executed at:13:59:27 and 23:59:27, which are UNEXPECTED.
image

More importantly, I cannot work out how to remove the potential 23:59:xx execution.

  1. seconds doesn't work in exclude:
    --excluded-times-of-day 16:00:00-23:59:59
    It failed to run as the parameter only support minutes input.

  2. trying with exclude: 0:00-14:00,16:00-23:59, 23:59-0:00
    -- but less optimistic with the third part working. '23:59-0:00'

@linki
Copy link
Owner

linki commented Feb 18, 2020

If I remember correctly the flag supports wrapping around. You could try --excluded-times-of-day=16:00-14:00. This should lead to an active period of 14:00:01-15:59:59.

@tonyairwallex
Copy link
Author

tonyairwallex commented Feb 18, 2020

If I remember correctly the flag supports wrapping around. You could try --excluded-times-of-day=16:00-14:00. This should lead to an active period of 14:00:01-15:59:59.

Thanks @linki
This part is not a big problem, as I mentioned above, the execution on 23:59:27 is a more concerning / unplanned killing far away from my monitoring period.

--- I cannot remove 23:59:xx execution anyway, and this could be one issue to everyone who wants to run certain time during the day.

@linki
Copy link
Owner

linki commented Feb 21, 2020

@tonyairwallex I understand.

If we assume that seconds default to 00 then this is the expected behaviour. But I agree there's no indication that this is actually happening.

We could either fail when users specify seconds specifically or somehow parse and support it: We would need to default it to 59 when it's the end of an interval and 00 when it's the beginning of an interval.

@tonyairwallex
Copy link
Author

@linki Exactly! I like the solution you proposed ~

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