fix Qdrant
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import threading
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any
|
||||
@@ -23,6 +22,8 @@ DEFAULT_PROFILE: dict[str, Any] = {
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_RAG_EXECUTOR = ThreadPoolExecutor(max_workers=2, thread_name_prefix="rag")
|
||||
|
||||
|
||||
class MemoryService:
|
||||
def __init__(self, db: Session, user_id: int):
|
||||
@@ -47,7 +48,7 @@ class MemoryService:
|
||||
except Exception:
|
||||
logger.exception("RAG background task failed")
|
||||
|
||||
threading.Thread(target=runner, daemon=True).start()
|
||||
_RAG_EXECUTOR.submit(runner)
|
||||
|
||||
@staticmethod
|
||||
def _rag_fact_payload(fact: MemoryFact) -> dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user