mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 21:29:12 +00:00
Automate updating embeddings, search index on a hourly schedule
- Use the schedule pypi package - Use QTimer to poll schedule.run_pending() regularly for jobs to run
This commit is contained in:
@@ -126,4 +126,6 @@ def search(q: str, n: Optional[int] = 5, t: Optional[SearchType] = None, r: Opti
|
||||
@api.get('/update')
|
||||
def update(t: Optional[SearchType] = None, force: Optional[bool] = False):
|
||||
state.model = configure_search(state.model, state.config, regenerate=force, t=t)
|
||||
logger.info("Search Index updated via API call")
|
||||
|
||||
return {'status': 'ok', 'message': 'index updated'}
|
||||
|
||||
Reference in New Issue
Block a user