diff --git a/models/site.rb b/models/site.rb index 531c81a3..0131ed0f 100644 --- a/models/site.rb +++ b/models/site.rb @@ -653,6 +653,7 @@ class Site < Sequel::Model PurgeCacheWorker.perform_async username, relative_path purge_file_path = Pathname(relative_path).dirname.to_s + purge_file_path = '' if purge_file_path == '.' purge_file_path += '/' if purge_file_path != '/' PurgeCacheWorker.perform_async username, '/?surf=1' if purge_file_path == '/' @@ -662,20 +663,8 @@ class Site < Sequel::Model end end - # TODO DRY this up - def delete_cache(path) - relative_path = path.gsub base_files_path, '' - - PurgeCacheWorker.perform_async username, relative_path - - # We gotta flush the dirname too if it's an index file. - if relative_path != '' && relative_path.match(/\/$|index\.html?$/i) - purge_file_path = Pathname(relative_path).dirname.to_s - - PurgeCacheWorker.perform_async username, '/?surf=1' if purge_file_path == '/' - PurgeCacheWorker.perform_async username, purge_file_path - end + purge_cache path end Rye::Cmd.add_command :ipfs, nil, 'add', :r