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

"invalid bitset position" thrown when calling cron::cron_next<cron::cron_quartz_traits>(...) #35

Open
hanexthink opened this issue Aug 29, 2023 · 0 comments

Comments

@hanexthink
Copy link

hanexthink commented Aug 29, 2023

Hi,
It is noticed that for a date and time entry that correspond to Sundays the cron::cron_next<cron::cron_quartz_traits>(...) function throws an invalid bitset position exception. This case is deterministic and could be produced with following code snippet for example.

        std::tm currentRunTime{};
	currentRunTime.tm_sec = 0;
	currentRunTime.tm_min = 0;
	currentRunTime.tm_hour = 0;
	currentRunTime.tm_mday = 3;
	currentRunTime.tm_mon = 8;
	currentRunTime.tm_year = 123;
	currentRunTime.tm_wday = 0;
	currentRunTime.tm_yday = 245;
	currentRunTime.tm_isdst = 1;

	auto quartzExpression{ "0 0 */12 * * 1-7" };
	auto cronExpr = cron::make_cron<cron::cron_quartz_traits>(quartzExpression);
	auto nextRunTime = cron::cron_next<cron::cron_quartz_traits>(cronExpr, currentRunTime);

We'll be glad to have your insight on this subject.
Kind regards,
Hossein Afshari
image

@hanexthink hanexthink changed the title Out of range exception thrown when calling cron::cron_next<cron::cron_quartz_traits>(...) "invalid bitset position" thrown when calling cron::cron_next<cron::cron_quartz_traits>(...) Aug 29, 2023
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

1 participant