mirror of https://github.com/logseq/logseq
fix(api): sometimes the http api server not auto restart
parent
34e806999f
commit
462967e7dc
|
@ -69,8 +69,8 @@
|
||||||
*configs (::configs _state)
|
*configs (::configs _state)
|
||||||
{:keys [host port autostart]} @*configs
|
{:keys [host port autostart]} @*configs
|
||||||
hp-changed? (or (not= host (:host server-state))
|
hp-changed? (or (not= host (:host server-state))
|
||||||
(not= (util/safe-parse-int port)
|
(not= (util/safe-parse-int (or port 0))
|
||||||
(util/safe-parse-int (:port server-state))))
|
(util/safe-parse-int (or (:port server-state) 0))))
|
||||||
changed? (or hp-changed? (->> [autostart (:autostart server-state)]
|
changed? (or hp-changed? (->> [autostart (:autostart server-state)]
|
||||||
(mapv #(cond-> % (nil? %) not))
|
(mapv #(cond-> % (nil? %) not))
|
||||||
(apply not=)))]
|
(apply not=)))]
|
||||||
|
@ -126,10 +126,11 @@
|
||||||
|
|
||||||
(rum/use-effect!
|
(rum/use-effect!
|
||||||
(fn []
|
(fn []
|
||||||
(ipc/ipc :server/load-state)
|
(p/let [_ (p/delay 1000)
|
||||||
(let [t (js/setTimeout #(when (state/sub [:electron/server :autostart])
|
_ (ipc/ipc :server/load-state)]
|
||||||
(ipc/ipc :server/do :restart)) 1000)]
|
(let [t (js/setTimeout #(when (state/sub [:electron/server :autostart])
|
||||||
#(js/clearTimeout t)))
|
(ipc/ipc :server/do :restart)) 1000)]
|
||||||
|
#(js/clearTimeout t))))
|
||||||
[])
|
[])
|
||||||
|
|
||||||
(let [{:keys [status error]} server-state
|
(let [{:keys [status error]} server-state
|
||||||
|
|
Loading…
Reference in New Issue