ZhiQiang Fan 2de5cfbd8c reset croniter to avoid cur time shift
When we evaluate alarms, we check the time constraints, and will check
if it is exactly match firstly, but croniter get_prev() and get_next() will
change croniter.cur time, then if it is not exactly match, the cur time is
no longer the current time, and the second call to get_prev() is not same
as first get_prev(), finally, a wrong value may returned.

For example, if start="0 11 31 * *", and current time is 2015-03-31T11:30:00,
then first get_prev() is 2015-03-31T11:00:00, but second one is 2015-05-01T11:00:00

This patch fixes it by creating a new croniter object with current time.

Change-Id: Iaeb1f763ffc33b726d132a234c8e4e08db00a8fe
Closes-Bug: #1438674
2015-04-01 19:52:57 +08:00
..
2015-02-11 11:48:42 +08:00