Skip to content

Commit

Permalink
Hopefully stop intermittent DRbConnErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
nixme committed Dec 1, 2011
1 parent 8d6e02c commit fb6470c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@
ends. Fixes [#1](https://github.com/nixme/pry-nav/issues/1).
* **step** and **next** now check for a local file context. Prevents errors and
infinite loops when called from outside `binding.pry`, e.g. `rails console`.
* More resilient cleanup when [pry-remote][pry-remote] CLI disconnects.


## 0.0.2 (2011-11-30)
Expand Down
12 changes: 9 additions & 3 deletions lib/pry-nav/pry_remote_ext.rb
@@ -1,4 +1,5 @@
require 'pry-remote'
require 'drb'

module PryRemote

Expand Down Expand Up @@ -58,11 +59,16 @@ def stop
# Reset system
Pry.config.system = @old_system

puts "[pry-remote] Remote sesion terminated"
@client.kill
begin
@client.kill
rescue DRb::DRbConnError
# Ignore connection errors. The CLI client may have killed itself.
ensure
DRb.stop_service
end

DRb.stop_service
@started = false
puts "[pry-remote] Remote sesion terminated"
end
end
end
Expand Down

0 comments on commit fb6470c

Please sign in to comment.