Skip to content

Commit 138a0eb

Browse files
committed
Make sure that the watcher gets started
If loading spring/commands (which loads the gemfile / spring.rb / etc) fails, we still need a watcher. It might end up being the polling watcher when the user has configured the listen watcher, but that's acceptable.
1 parent 1947bbf commit 138a0eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/spring/application.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ def start_watcher
6868
def preload
6969
log "preloading app"
7070

71-
require "spring/commands"
72-
start_watcher
71+
begin
72+
require "spring/commands"
73+
ensure
74+
start_watcher
75+
end
7376

7477
require Spring.application_root_path.join("config", "application")
7578

0 commit comments

Comments
 (0)