core[patch]: Ignore ASYNC110 to upgrade to newest ruff version (#27229)

Ignoring ASYNC110 with explanation
This commit is contained in:
Eugene Yurtsev 2024-10-09 11:25:58 -04:00 committed by GitHub
parent 7da2efd9d3
commit 5b9b8fe80f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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