From 2f7f5a54676a557678a7a55690f7baf4844561e4 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 15 Oct 2017 10:43:26 -0700 Subject: [PATCH] fixes for ipfs archiving --- models/site.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/models/site.rb b/models/site.rb index 0131ed0f..a758d6da 100644 --- a/models/site.rb +++ b/models/site.rb @@ -667,7 +667,7 @@ class Site < Sequel::Model purge_cache path end - Rye::Cmd.add_command :ipfs, nil, 'add', :r + Rye::Cmd.add_command :ipfs, nil, 'add', :r, :Q def add_to_ipfs # Not ideal. An SoA version is in progress. @@ -680,17 +680,15 @@ class Site < Sequel::Model rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user'] begin response = rbox.ipfs "sites/#{self.class.sharding_dir self.username}/#{self.username.gsub(/\/|\.\./, '')}" - output_array = response ensure rbox.disconnect end else - line = Cocaine::CommandLine.new('ipfs', 'add -r :path') + line = Cocaine::CommandLine.new('ipfs', 'add -r -Q :path') response = line.run path: files_path - output_array = response.to_s.split("\n") end - output_array.last.split(' ')[1] + response.first end def purge_old_archives