Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[RateLimiter] Add support for long intervals (months and years)#43060

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@alexandre-daubois
Copy link
Member

@alexandre-dauboisalexandre-daubois commentedSep 16, 2021
edited
Loading

QA
Branch?5.4
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#42784
LicenseMIT
Doc PRNA

As mentioned in the issue and as found on Stackoverflow, we may use timestamps instead of convertingDateInterval properties to seconds.

@derrabus
Copy link
Member

Tests please. 🙂

@alexandre-daubois
Copy link
MemberAuthor

@derrabus indeed! Wasn't sure which tests to add though. But I'll definitely try to find some! 😄

@derrabus
Copy link
Member

Well, you should be able to come up with a test that fails on 5.4 and passes after your changes. After all, you're fixing a problem here. 😎

alexandre-daubois reacted with rocket emoji

@alexandre-daubois
Copy link
MemberAuthor

alexandre-daubois commentedSep 16, 2021
edited
Loading

Oh yeah of course you're right! Just added them. If you see anything else, please tell me!

Speaking of that, should this be rebased to 5.3 as a bug fix or is it considered as a feature and 5.4 is fine?

@alexandre-dauboisalexandre-dauboisforce-pushed thefeat/rate-limiter-long-interval branch fromfcfde37 todd44a83CompareSeptember 16, 2021 16:33
@fabpot
Copy link
Member

That’s a new feature

alexandre-daubois and ging-dev reacted with thumbs up emoji

@alexandre-dauboisalexandre-dauboisforce-pushed thefeat/rate-limiter-long-interval branch 3 times, most recently froma3bcb2b toa1d2d61CompareSeptember 17, 2021 06:30

yield ['PT2H4M',2 *3600 +4 *60];

yield ['P1Y',24 *3600 *365];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would expect that this test will start to fail on March 1st, 2023. 🤓

Copy link
MemberAuthor

@alexandre-dauboisalexandre-dauboisSep 17, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm struggling a bit with these tests, as months and years, of course, may have different number of days. Any advice welcome about this one!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is the variable length of the limit desired? So far, the rate limiter worked with fixed lengths, IIRC. We would change that now.

Copy link
MemberAuthor

@alexandre-dauboisalexandre-dauboisSep 17, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm wondering if it's worth testing this method doing a simple timestamp operation. What I mean is if it changes,FixedWindowLimiter tests and similar will break, as I updatedFixedWindowLimiterTest with long intervals too.

The lack of tests onTimeUtil currently makes me wonder even more.

---

* The component is not experimental anymore
* Add support of long intervals (months and years)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
* Add supportof long intervals (months and years)
* Add supportfor long intervals (months and years)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Of course, fixed. Thanks, Oskar!

@alexandre-dauboisalexandre-daubois changed the title[RateLimiter] Add support of long intervals (months and years)[RateLimiter] Add support for long intervals (months and years)Sep 20, 2021
@alexandre-dauboisalexandre-dauboisforce-pushed thefeat/rate-limiter-long-interval branch froma1d2d61 to342164eCompareSeptember 20, 2021 17:05
@fabpot
Copy link
Member

Thank you@alexandre-daubois.

@fabpotfabpot merged commit303f0c9 intosymfony:5.4Oct 29, 2021
@alexandre-dauboisalexandre-daubois deleted the feat/rate-limiter-long-interval branchOctober 29, 2021 13:32
@fabpotfabpot mentioned this pull requestNov 5, 2021
@fabpotfabpot mentioned this pull requestNov 5, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@derrabusderrabusderrabus left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

[RateLimiter] It does not work with long intervals (1 month, 1 year)

5 participants

@alexandre-daubois@derrabus@fabpot@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp