mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Simplify Limiter implementation
This commit is contained in:
parent
20a24dbcbf
commit
0096d83387
1 changed files with 1 additions and 4 deletions
|
|
@ -9,8 +9,5 @@ class Limiter:
|
|||
|
||||
@asynccontextmanager
|
||||
async def limit(self) -> AsyncIterator[None]:
|
||||
await self._semaphore.acquire()
|
||||
try:
|
||||
async with self._semaphore:
|
||||
yield
|
||||
finally:
|
||||
self._semaphore.release()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue