This commit is contained in:
Nuno Campos
2024-10-19 15:11:18 -07:00
parent 42648c88dd
commit 7d3f2ca3ed
+3 -1
View File
@@ -124,7 +124,9 @@ class AsyncBackgroundExecutor(AsyncContextManager):
self.sentinel = object()
self.loop = asyncio.get_running_loop()
if max_concurrency := config.get("max_concurrency"):
self.semaphore = asyncio.Semaphore(max_concurrency)
self.semaphore: Optional[asyncio.Semaphore] = asyncio.Semaphore(
max_concurrency
)
else:
self.semaphore = None