Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #264, stopping the server if no more sever bound builds are running #288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/figwheel/main/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
[build-id]
;; This is all ad-hoc need to move to a notion of starting and stopping
(if-let [build-info (get @fig/build-registry build-id)]
(let [{:keys [repl-env repl-options]} build-info]
(let [{:keys [repl-options] {:keys [server] :as repl-env} :repl-env} build-info]

(log/info (format "Stopping the watcher for build - %s" build-id))
(fww/remove-watch! [::autobuild build-id])
Expand All @@ -126,7 +126,10 @@

(swap! fig/build-registry dissoc build-id)

(when (zero? (count @fig/build-registry))
(when (->> @fig/build-registry
(vals)
(filter (comp #{server} :server :repl-env))
(empty?))
(log/info "Doing final clean up")
(log/info (format "Stopping the Figwheel server" build-id))
(figwheel.repl/tear-down-server repl-env)
Expand Down