Skip to content

Commit

Permalink
Fix for rate limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
tofarr committed Nov 19, 2024
1 parent a46cea6 commit ec21259
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openhands/server/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, requests: int = 2, seconds: int = 1, sleep_seconds: int = 1):
self.requests = requests
self.seconds = seconds
self.history = defaultdict(list)
self.sleep_seconds = sleep_seconds

def _clean_old_requests(self, key: str) -> None:
now = datetime.now()
Expand Down

0 comments on commit ec21259

Please sign in to comment.