unpin code for pruning excessive ipfs archives

This commit is contained in:
Kyle Drake 2016-02-13 17:47:00 -08:00
parent 7cce210f90
commit 8aa0061ab4
3 changed files with 32 additions and 1 deletions

View file

@ -641,6 +641,12 @@ class Site < Sequel::Model
output_array.last.split(' ')[1]
end
def purge_old_archives
archives_dataset.order(:updated_at).offset(Archive::MAXIMUM_ARCHIVES_PER_SITE).all.each do |archive|
archive.destroy
end
end
def archive!
#if ENV["RACK_ENV"] == 'test'
# ipfs_hash = "QmcKi2ae3uGb1kBg1yBpsuwoVqfmcByNdMiZ2pukxyLWD8"