Skip to content

Commit

Permalink
Merge pull request #7 from JonahTzuChi/3-bug-cleanup_threshold-should…
Browse files Browse the repository at this point in the history
…-not-be-lower-than-the-time_window

3 bug cleanup threshold should not be lower than the time window
  • Loading branch information
JonahWhaler authored Jul 8, 2024
2 parents 0a56d0a + 554dd37 commit 48f38f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pygrl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
self.__max_requests = max_requests
self.__time_window = time_window
self.__capacity = max_capacity
self.__cleanup_threshold = cleanup_threshold
self.__cleanup_threshold = cleanup_threshold if cleanup_threshold > time_window else time_window

def check_limit(self, key: str) -> bool:
"""
Expand Down Expand Up @@ -149,7 +149,7 @@ def __init__(
self.__max_requests = max_requests
self.__time_window = time_window
self.__capacity = max_capacity
self.__cleanup_threshold = cleanup_threshold
self.__cleanup_threshold = cleanup_threshold if cleanup_threshold > time_window else time_window
self.__lock = asyncio.Lock()

async def check_limit(self, key: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# python3 setup.py sdist bdist_wheel
# twine upload --skip-existing dist/* --verbose

VERSION = '0.0.3.1'
VERSION = '0.0.3.2'

setup(
name='pygrl',
Expand Down

0 comments on commit 48f38f1

Please sign in to comment.