Minor suggestions
Opened this issue · 0 comments
alphapapa commented
Hi,
FYI, in this code:
Lines 591 to 592 in d50dd19
Rather than pass :else 'ignore
to plz
, you should probably wrap plz
in ignore-errors
, because it appears that you want those requests to be synchronous.
Generally, you could probably simplify it like this:
(cl-defmethod ready-p ((proxy kele--proxy-record))
"Return non-nil if the PROXY is ready for requests.
Returns nil on any curl error."
(let ((ready-addr (format "%s/readyz" (kele--url proxy)))
(live-addr (format "%s/livez" (kele--url proxy))))
(ignore-errors
(and (= 200 (plz-response-status (plz 'get ready-addr :as 'response)))
(= 200 (plz-response-status (plz 'get live-addr :as 'response)))))))
The same is probably so for the earlier place in the file where a similar check is done. :)