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

fix: improve rate limit handling #364

Merged
merged 5 commits into from
May 23, 2023
Merged

fix: improve rate limit handling #364

merged 5 commits into from
May 23, 2023

Conversation

reneaaron
Copy link
Contributor

@reneaaron reneaaron commented May 19, 2023

  • Fix docs
  • Remove default rate limit for non-strict endpoints
  • Change strict endpoint rate limiting to requests / second (instead of every X seconds)
  • Rate limit based on user id (if available, instead of IP) ➡️ NWC

reneaaron and others added 2 commits May 19, 2023 18:45
We always treat the rate limit settings as requests per second and not every second.
The default rate limit is set globally
additionally we set a strict rate limit for sending payments
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Merging #364 (ce67469) into main (a6df81d) will decrease coverage by 0.18%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #364      +/-   ##
==========================================
- Coverage   54.96%   54.79%   -0.18%     
==========================================
  Files          51       51              
  Lines        3180     3190      +10     
==========================================
  Hits         1748     1748              
- Misses       1246     1256      +10     
  Partials      186      186              
Impacted Files Coverage Δ
main.go 0.00% <0.00%> (ø)

@bumi bumi requested a review from kiwiidb May 21, 2023 14:42
@bumi bumi self-assigned this May 21, 2023
Copy link
Contributor

@kiwiidb kiwiidb left a comment

Choose a reason for hiding this comment

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

Looks good, I would just remove the Printf statement (if you really want to log it then you should use the logger).

@bumi
Copy link
Contributor

bumi commented May 23, 2023

that was a debug statement, removed.

@bumi bumi requested a review from kiwiidb May 23, 2023 11:30
@kiwiidb kiwiidb merged commit db74659 into main May 23, 2023
@kiwiidb kiwiidb deleted the fix/rate-limit-fixup branch May 23, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants