Skip to content

Commit cdee470

Browse files
blahgeekMatthewZMD
authored andcommitted
Wait for a bit longer time for the backend to be ready
1 parent 680014b commit cdee470

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

aidermacs.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,11 @@ If CALLBACK is non-nil it will be called after the command finishes."
488488
(processed-command (aidermacs--process-message-if-multi-line command)))
489489
;; Check if command may edit files and prepare accordingly
490490
(with-current-buffer buffer
491-
;; Attempt to wait out transient commands or server lag
492-
(when (not aidermacs--ready)
493-
(sit-for 0.5))
491+
;; Attempt to wait out transient commands or server lag for max 3s
492+
(let ((max-wait-count 30))
493+
(while (and (not aidermacs--ready) (> max-wait-count 0))
494+
(sit-for 0.1)
495+
(setq max-wait-count (1- max-wait-count))))
494496
(if (not aidermacs--ready)
495497
(progn (aidermacs-switch-to-buffer buffer-name)
496498
(message "Aider process is not currently accepting commands"))

0 commit comments

Comments
 (0)