mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-01 19:03:25 +00:00
core[patch]: Ignore ASYNC110 to upgrade to newest ruff version (#27229)
Ignoring ASYNC110 with explanation
This commit is contained in:
parent
7da2efd9d3
commit
5b9b8fe80f
@ -249,7 +249,13 @@ class InMemoryRateLimiter(BaseRateLimiter):
|
||||
return self._consume()
|
||||
|
||||
while not self._consume():
|
||||
await asyncio.sleep(self.check_every_n_seconds)
|
||||
# This code ignores the ASYNC110 warning which is a false positive in this
|
||||
# case.
|
||||
# There is no external actor that can mark that the Event is done
|
||||
# since the tokens are managed by the rate limiter itself.
|
||||
# It needs to wake up to re-fill the tokens.
|
||||
# https://docs.astral.sh/ruff/rules/async-busy-wait/
|
||||
await asyncio.sleep(self.check_every_n_seconds) # ruff: noqa: ASYNC110
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user