Lock scanner processing to a single runner

This commit is contained in:
Zoe Roux 2025-11-20 12:11:15 +01:00
parent 5bc6a06b91
commit 05f7fabb3c
No known key found for this signature in database

View File

@ -55,6 +55,7 @@ class RequestProcessor:
self._database: Connection = None # type: ignore
self._client = client
self._providers = providers
self._processing = False
@tracer.start_as_current_span("listen_requests")
async def listen(self, tg: TaskGroup):
@ -85,6 +86,10 @@ class RequestProcessor:
raise
async def process_all(self):
if self._processing:
return
self._processing = True
try:
found = True
while found:
try:
@ -93,6 +98,8 @@ class RequestProcessor:
logger.error(
"Failed to process one of the metadata request", exc_info=e
)
finally:
self._processing = False
async def process_request(self):
cur = await self._database.fetchrow(