diff --git a/src/khoj/configure.py b/src/khoj/configure.py index ff67fc19..44ba4ec2 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -67,12 +67,14 @@ def configure_routes(app): app.include_router(web_client) -@schedule.repeat(schedule.every(61).minutes) -def update_search_index(): - state.search_index_lock.acquire() - state.model = configure_search(state.model, state.config, regenerate=False) - state.search_index_lock.release() - logger.info("📬 Search index updated via Scheduler") +if not state.demo: + + @schedule.repeat(schedule.every(61).minutes) + def update_search_index(): + state.search_index_lock.acquire() + state.model = configure_search(state.model, state.config, regenerate=False) + state.search_index_lock.release() + logger.info("📬 Search index updated via Scheduler") def configure_search_types(config: FullConfig): diff --git a/src/khoj/main.py b/src/khoj/main.py index 81a4b035..466d17ff 100644 --- a/src/khoj/main.py +++ b/src/khoj/main.py @@ -65,9 +65,8 @@ def run(): logger.info("🌘 Starting Khoj") if not args.gui: - if not state.demo: - # Setup task scheduler - poll_task_scheduler() + # Setup task scheduler + poll_task_scheduler() # Start Server configure_server(args, required=False) diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index fd53c5f2..9fe68db9 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -41,6 +41,7 @@ from fastapi.responses import StreamingResponse api = APIRouter() logger = logging.getLogger(__name__) +# If it's a demo instance, prevent updating any of the configuration. if not state.demo: @api.get("/config/data", response_model=FullConfig)