mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Make auto-update of content index user configurable from khoj.el
This commit is contained in:
@@ -98,6 +98,11 @@
|
|||||||
:group 'khoj
|
:group 'khoj
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom khoj-auto-index t
|
||||||
|
"Should content be automatically re-indexed every `khoj-index-interval' seconds."
|
||||||
|
:group 'khoj
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom khoj-index-interval 3600
|
(defcustom khoj-index-interval 3600
|
||||||
"Interval (in seconds) to wait before updating content index."
|
"Interval (in seconds) to wait before updating content index."
|
||||||
:group 'khoj
|
:group 'khoj
|
||||||
@@ -444,8 +449,9 @@ Use `BOUNDARY' to separate files. This is sent to Khoj server as a POST request.
|
|||||||
(when khoj--index-timer
|
(when khoj--index-timer
|
||||||
(cancel-timer khoj--index-timer))
|
(cancel-timer khoj--index-timer))
|
||||||
;; Send files to index on server every `khoj-index-interval' seconds
|
;; Send files to index on server every `khoj-index-interval' seconds
|
||||||
|
(when khoj-auto-index
|
||||||
(setq khoj--index-timer
|
(setq khoj--index-timer
|
||||||
(run-with-timer 60 khoj-index-interval 'khoj--server-index-files))
|
(run-with-timer 60 khoj-index-interval 'khoj--server-index-files)))
|
||||||
|
|
||||||
|
|
||||||
;; -------------------------------------------
|
;; -------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user