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

Avoid search rate limit #704

Merged
merged 1 commit into from
Oct 7, 2023
Merged

Avoid search rate limit #704

merged 1 commit into from
Oct 7, 2023

Conversation

Sjmarf
Copy link
Contributor

@Sjmarf Sjmarf commented Oct 6, 2023

Got a rate limit whilst searching. This PR reduces the number of API requests we make by refreshing the search results less often.

Before this PR

Search was refreshed every time the search field content is changed (ie, when the user types another letter)

After this PR

Search is refreshed if the user stops typing for 0.2 seconds (thoughts on this delay? I type faster than 0.2 seconds per key so it works for me, but this may not be true for everyone)

@Sjmarf Sjmarf requested a review from a team as a code owner October 6, 2023 20:33
@Sjmarf Sjmarf requested review from mormaer and EricBAndrews and removed request for a team October 6, 2023 20:33
Copy link
Member

@EricBAndrews EricBAndrews left a comment

Choose a reason for hiding this comment

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

Nice! Very clean solution.

@Sjmarf Sjmarf merged commit c04d3c2 into dev Oct 7, 2023
4 checks passed
@Sjmarf Sjmarf deleted the sjmarf/search-rate-limit branch October 7, 2023 07:50
boscojwho added a commit that referenced this pull request Oct 11, 2023
boscojwho pushed a commit that referenced this pull request Nov 23, 2023
(cherry picked from commit c04d3c2)
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

Successfully merging this pull request may close these issues.

2 participants