mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Auto configure server before loading khoj-menu
If the config hasn't changed there'll be no update. If config has changed indexing will get triggered asynchronously. But user cannot make query till indexing done As easier to know when server ready to configure
This commit is contained in:
parent
8a21aff438
commit
d7fb9a596e
1 changed files with 4 additions and 1 deletions
|
@ -266,7 +266,9 @@ for example), set this to the full interpreter path."
|
||||||
(setq khoj--server-ready? nil))
|
(setq khoj--server-ready? nil))
|
||||||
:filter (lambda (process msg)
|
:filter (lambda (process msg)
|
||||||
(cond ((string-match (format "Uvicorn running on %s" khoj-server-url) msg)
|
(cond ((string-match (format "Uvicorn running on %s" khoj-server-url) msg)
|
||||||
(setq khoj--server-ready? t))
|
(progn
|
||||||
|
(setq khoj--server-ready? t)
|
||||||
|
(khoj--server-configure)))
|
||||||
((not khoj--server-ready?)
|
((not khoj--server-ready?)
|
||||||
(dolist (line (split-string msg "\n"))
|
(dolist (line (split-string msg "\n"))
|
||||||
(message "khoj.el: %s" (nth 1 (split-string msg " " t " *"))))))
|
(message "khoj.el: %s" (nth 1 (split-string msg " " t " *"))))))
|
||||||
|
@ -923,6 +925,7 @@ Paragraph only starts at first text after blank line."
|
||||||
(khoj--server-setup))
|
(khoj--server-setup))
|
||||||
(while (not khoj--server-ready?)
|
(while (not khoj--server-ready?)
|
||||||
(sleep-for 0.5))
|
(sleep-for 0.5))
|
||||||
|
(khoj--server-configure)
|
||||||
(khoj--menu))
|
(khoj--menu))
|
||||||
|
|
||||||
(provide 'khoj)
|
(provide 'khoj)
|
||||||
|
|
Loading…
Reference in a new issue