mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
fix potential cancelling race with full queue
This commit is contained in:
@@ -38,6 +38,7 @@ class QueryPool:
|
|||||||
""" Schedule a query for execution.
|
""" Schedule a query for execution.
|
||||||
"""
|
"""
|
||||||
if self.is_cancelled:
|
if self.is_cancelled:
|
||||||
|
self.clear_queue()
|
||||||
await self.finish()
|
await self.finish()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ class QueryPool:
|
|||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
|
|
||||||
if self.is_cancelled:
|
if self.is_cancelled:
|
||||||
|
self.clear_queue()
|
||||||
await self.finish()
|
await self.finish()
|
||||||
|
|
||||||
async def finish(self) -> None:
|
async def finish(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user