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

Optimize detection of endless rule iterations #581

Open
phil-davis opened this issue Aug 17, 2022 · 1 comment
Open

Optimize detection of endless rule iterations #581

phil-davis opened this issue Aug 17, 2022 · 1 comment

Comments

@phil-davis
Copy link
Contributor

#564 (comment)

There are cases when a rule specifies a combination that never happens in the calendar. If the RRuleIterator is being asked to generate some occurrences of the event, then it loops. We currently stop those by "brute force" - when the loop gets to 9999-12-31 we exit.

If we analyse the request, we should be able to detect request patterns that will never match any actual calendar dates, and return quickly with just the first date of the event and no recurrences. That would save looping through days/months/years all the way to 9999.

@phil-davis
Copy link
Contributor Author

I noticed old PR #416 - that might have some ideas for catching these things without looping all the way to year 9999?

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