ソースを参照

fix: restart API server consistently

UI inconsistently loses server status. This fix allows for always
restarting correctly, regardless of the UI bug
Gabriel Horner 1 ヶ月 前
コミット
a4a1b16852
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/electron/electron/server.cljs

+ 2 - 2
src/electron/electron/server.cljs

@@ -120,7 +120,7 @@
 
 (defn close!
   []
-  (when (and @*server (contains? #{:running :error} (:status @*state)))
+  (when (and @*server (contains? #{:running :error nil} (:status @*state)))
     (logger/debug "[server] closing ...")
     (set-status! :closing)
     (-> (.close @*server)
@@ -167,7 +167,7 @@
     :start (when (contains? #{nil :closed :error} (:status @*state))
              (start!))
     :stop (close!)
-    :restart (start!)
+    :restart (p/do! (close!) (start!))
     :else :dune))
 
 (defn setup!