ensure that ssh disconnects

This commit is contained in:
Kyle Drake 2015-05-30 12:37:58 -07:00
parent d58e678dd0
commit a48d5db958

View file

@ -563,9 +563,12 @@ class Site < Sequel::Model
# Not ideal. An SoA version is in progress.
if $config['ipfs_ssh_host'] && $config['ipfs_ssh_user']
rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user']
response = rbox.ipfs "sites/#{self.username.gsub(/\/|\.\./, '')}"
output_array = response
rbox.disconnect
begin
response = rbox.ipfs "sites/#{self.username.gsub(/\/|\.\./, '')}"
output_array = response
ensure
rbox.disconnect
end
else
line = Cocaine::CommandLine.new('ipfs', 'add -r :path')
response = line.run path: files_path