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.

Use settings instead of hardcoded constants for refresh intervals

LearningCircuit5fc5760c6d0f
diff --git a/src/local_deep_research/news/api.py b/src/local_deep_research/news/api.py
index aec289b045..332ec84ea6 100644
--- a/src/local_deep_research/news/api.py
+++ b/src/local_deep_research/news/api.py
@@ -915,7 +915,7 @@ def create_subscription(
user_id: str,
query: str,
subscription_type: str = "search",
- refresh_minutes: int = 240, # Default 4 hours
+ refresh_minutes: int = None,
source_research_id: Optional[str] = None,
model_provider: Optional[str] = None,
model: Optional[str] = None,
@@ -946,6 +946,17 @@ def create_subscription(
from datetime import datetime, timedelta
import uuid
+ # Get default refresh interval from settings if not provided
+ if refresh_minutes is None:
+ try:
+ from ..utilities.db_utils import get_setting_from_db_main_thread
+
+ refresh_minutes = get_setting_from_db_main_thread(
+ "news.subscription.refresh_minutes", 240
+ )
+ except Exception:
+ refresh_minutes = 240 # Fallback to 4 hours
+
with get_user_db_session(user_id) as db_session:
# Create new subscription
subscription = NewsSubscription(
diff --git a/src/local_deep_research/news/flask_api.py b/src/local_deep_research/news/flask_api.py
index 3779d2ea4d..5b43c82384 100644
--- a/src/local_deep_research/news/flask_api.py
+++ b/src/local_deep_research/news/flask_api.py
@@ -107,7 +107,7 @@ def create_subscription() -> Dict[str, Any]:
JSON body:
query: Search query or topic
subscription_type: "search" or "topic" (default: "search")
- refresh_minutes: Refresh interval in minutes (default: 240)
+ refresh_minutes: Refresh interval in minutes (default: from settings)
"""
try:
data = request.get_json(force=True)
@@ -125,7 +125,9 @@ def create_subscription() -> Dict[str, Any]:
# Extract parameters
query = data.get("query")
subscription_type = data.get("subscription_type", "search")
- refresh_minutes = data.get("refresh_minutes", 240) # Default 4 hours
+ refresh_minutes = data.get(
+ "refresh_minutes"
+ ) # Will use default from api.py
# Extract model configuration (optional)
model_provider = data.get("model_provider")