mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Clear any network connections to khoj server via khoj.el on reindex
- Ignore errors in deleting network requests to khoj server - Also delete open network connection to khoj server on auto reindex Otherwise when server is unreachable a bunch of failed network connections accrue in the processes list
This commit is contained in:
@@ -411,13 +411,15 @@ Auto invokes setup steps on calling main entrypoint."
|
|||||||
(lambda (status)
|
(lambda (status)
|
||||||
(if (not status)
|
(if (not status)
|
||||||
(message "khoj.el: %scontent index %supdated" (if content-type (format "%s " content-type) "all ") (if force "force " ""))
|
(message "khoj.el: %scontent index %supdated" (if content-type (format "%s " content-type) "all ") (if force "force " ""))
|
||||||
|
(progn
|
||||||
|
(khoj--delete-open-network-connections-to-server)
|
||||||
(with-current-buffer (current-buffer)
|
(with-current-buffer (current-buffer)
|
||||||
(search-forward "\n\n" nil t)
|
(search-forward "\n\n" nil t)
|
||||||
(message "khoj.el: Failed to %supdate %s content index. Status: %s%s"
|
(message "khoj.el: Failed to %supdate %s content index. Status: %s%s"
|
||||||
(if force "force " "")
|
(if force "force " "")
|
||||||
(if content-type (format "%s " content-type) "all")
|
(if content-type (format "%s " content-type) "all")
|
||||||
(string-trim (format "%s %s" (nth 1 (nth 1 status)) (nth 2 (nth 1 status))))
|
(string-trim (format "%s %s" (nth 1 (nth 1 status)) (nth 2 (nth 1 status))))
|
||||||
(if (> (- (point-max) (point)) 0) (format ". Response: %s" (string-trim (buffer-substring-no-properties (point) (point-max)))) "")))))
|
(if (> (- (point-max) (point)) 0) (format ". Response: %s" (string-trim (buffer-substring-no-properties (point) (point-max)))) ""))))))
|
||||||
nil t t)))
|
nil t t)))
|
||||||
(setq khoj--indexed-files files-to-index)))
|
(setq khoj--indexed-files files-to-index)))
|
||||||
|
|
||||||
@@ -864,7 +866,7 @@ RECEIVE-DATE is the message receive date."
|
|||||||
(let ((proc-buf (buffer-name (process-buffer proc)))
|
(let ((proc-buf (buffer-name (process-buffer proc)))
|
||||||
(khoj-network-proc-buf (string-join (split-string khoj-server-url "://") " ")))
|
(khoj-network-proc-buf (string-join (split-string khoj-server-url "://") " ")))
|
||||||
(when (string-match (format "%s" khoj-network-proc-buf) proc-buf)
|
(when (string-match (format "%s" khoj-network-proc-buf) proc-buf)
|
||||||
(delete-process proc)))))
|
(ignore-errors (delete-process proc))))))
|
||||||
|
|
||||||
(defun khoj--teardown-incremental-search ()
|
(defun khoj--teardown-incremental-search ()
|
||||||
"Teardown hooks used for incremental search."
|
"Teardown hooks used for incremental search."
|
||||||
|
|||||||
Reference in New Issue
Block a user