mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
ensure that ssh disconnects
This commit is contained in:
parent
d58e678dd0
commit
a48d5db958
1 changed files with 6 additions and 3 deletions
|
@ -563,9 +563,12 @@ class Site < Sequel::Model
|
||||||
# Not ideal. An SoA version is in progress.
|
# Not ideal. An SoA version is in progress.
|
||||||
if $config['ipfs_ssh_host'] && $config['ipfs_ssh_user']
|
if $config['ipfs_ssh_host'] && $config['ipfs_ssh_user']
|
||||||
rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user']
|
rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user']
|
||||||
|
begin
|
||||||
response = rbox.ipfs "sites/#{self.username.gsub(/\/|\.\./, '')}"
|
response = rbox.ipfs "sites/#{self.username.gsub(/\/|\.\./, '')}"
|
||||||
output_array = response
|
output_array = response
|
||||||
|
ensure
|
||||||
rbox.disconnect
|
rbox.disconnect
|
||||||
|
end
|
||||||
else
|
else
|
||||||
line = Cocaine::CommandLine.new('ipfs', 'add -r :path')
|
line = Cocaine::CommandLine.new('ipfs', 'add -r :path')
|
||||||
response = line.run path: files_path
|
response = line.run path: files_path
|
||||||
|
|
Loading…
Add table
Reference in a new issue