stream site download zip

This commit is contained in:
Kyle Drake 2023-08-08 15:45:05 -05:00
parent d16bc0bace
commit 6c4a80123c
3 changed files with 19 additions and 17 deletions

View file

@ -83,8 +83,6 @@ class Site < Sequel::Model
THUMBNAIL_RESOLUTIONS = ['210x158']
MAX_FILE_SIZE = 10**8 # 100 MB
MAX_SITE_DOWNLOAD_SIZE = 200_000_000 # 200MB
MAX_SITE_FILES_DOWNLOAD = 500
CLAMAV_THREAT_MATCHES = [
/^VBS/,
@ -1353,10 +1351,6 @@ class Site < Sequel::Model
((total_space_used.to_f / maximum_space) * 100).round(1)
end
def too_big_to_download?
space_used > MAX_SITE_DOWNLOAD_SIZE || site_files_dataset.count > MAX_SITE_FILES_DOWNLOAD
end
# Note: Change Stat#prune! and the nginx map compiler if you change this business logic.
def supporter?
owner.plan_type != 'free'