Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

refactor: Use send_queue_failed_notification() helper in processor

LearningCircuit0ab2b3098f87
diff --git a/src/local_deep_research/web/queue/processor.py b/src/local_deep_research/web/queue/processor.py
index 2a4c7c0d4b..d66184da0b 100644
--- a/src/local_deep_research/web/queue/processor.py
+++ b/src/local_deep_research/web/queue/processor.py
@@ -13,6 +13,7 @@ from ...database.models import (
UserActiveResearch,
)
from ...database.models.memory_queue import get_memory_queue_tracker
+from ...notifications.queue_helpers import send_queue_failed_notification
from ..routes.globals import active_research, termination_flags
from ..services.research_service import (
run_research_process,
@@ -577,35 +578,27 @@ class QueueProcessor:
# Send failure notification if status is 'failed'
if op_data["status"] == "failed":
try:
- from ...notifications import EventType
- from ...notifications.manager import NotificationManager
from ...settings import SettingsManager
# Get settings snapshot from database session
settings_manager = SettingsManager(db_session)
settings_snapshot = settings_manager.get_settings_snapshot()
- # Create notification manager with settings snapshot
- notification_manager = NotificationManager(
+ # Send notification using the helper function
+ success = send_queue_failed_notification(
+ username=op_data["username"],
+ research_id=research_id,
+ query=research.query or "Unknown query",
+ error_message=op_data.get(
+ "error_message", "Unknown error"
+ ),
settings_snapshot=settings_snapshot,
- user_id=op_data["username"],
)
- # Build notification context
- context = {
- "query": research.query or "Unknown query",
- "research_id": research_id,
- "error": op_data.get("error_message", "Unknown error"),
- }
-
- # Send notification using the manager
- notification_manager.send_notification(
- event_type=EventType.RESEARCH_FAILED,
- context=context,
- )
- logger.info(
- f"Sent failure notification for research {research_id}"
- )
+ if success:
+ logger.info(
+ f"Sent failure notification for research {research_id}"
+ )
except Exception:
logger.exception(
f"Failed to send failure notification for {research_id}"