INNER CODE UNIT · Python
check
alisaifee/limits · limits/aio/storage/memcached/__init__.py:118
async def check(self) -> bool:
return await self.bridge.check()
async def acquire_sliding_window_entry(
self,
key: str,
limit: int,
expiry: int,
amount: int = 1,
) -> bool:
if amount > limit:
return False
now = time.time()
previous_key, current_key = self.sliding_window_keys(key, expiry, now)
(
previous_count,
previous_ttl,
current_count,