chore: replace deprecated asyncio.ensure_future with create_task, add inline comments to db.py

This commit is contained in:
gramps
2026-07-19 15:58:34 -07:00
parent 2685a73897
commit a99345edb6
3 changed files with 34 additions and 5 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ async def query_rag(query: str, limit: int = 3) -> list:
pid = r.get("id")
if pid:
current = r.get("payload", {}).get("retrieval_count", 0) or 0
asyncio.ensure_future(_update_retrieval_count(pid, current))
# Fire-and-forget: update retrieval count without blocking the response
asyncio.create_task(_update_retrieval_count(pid, current))
return results
except Exception as e:
log.warning(f"RAG query error: {e}")