-
Notifications
You must be signed in to change notification settings - Fork 345
Gracefully deal with dangling symlinks #522
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
Conversation
0ce76f5
to
c6733ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good in general, I have some code style differences but... whatevs :)
lib/spring/application.rb
Outdated
|
||
@watcher.on_debug do |message| | ||
spring_env.log "[watcher:#{app_env}] #{message}" | ||
end if @watcher.respond_to?(:on_debug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the conditional needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the poller watcher implements it. Calling it on the listen watcher would bomb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's defined in the abstract class which the listen watcher inherits from?
lib/spring/watcher/abstract.rb
Outdated
item.readlink.exist?.tap do |exists| | ||
debug do | ||
"add: ignoring dangling symlink: #{item.inspect} -> #{item.readlink.inspect}" | ||
end if !exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a fan of this style of postfix conditional on a multi-line block personally (I think it's harder to spot what the conditional is doing...)
21dc781
to
f923cf1
Compare
…Spring application logger
* Don't add files that are dangling symlinks * When watching a directory, ignore dangling symlinks rather than treating them as forever-stale
f923cf1
to
59bde9e
Compare
Gracefully deal with dangling symlinks
Add a watcher logging facility so such things can be diagnosed and debugged.