diff --git a/lib/disk_space.rb b/lib/disk_space.rb index f3cfd256127..9903164e3c1 100644 --- a/lib/disk_space.rb +++ b/lib/disk_space.rb @@ -2,13 +2,19 @@ class DiskSpace def self.uploads_used_bytes - # used(uploads_path) - # temporary (on our internal setup its just too slow to iterate) - Upload.sum(:filesize).to_i + if Discourse.store.external? + Upload.sum(:filesize).to_i + OptimizedImage.sum(:filesize).to_i + else + used(uploads_path) + end end def self.uploads_free_bytes - free(uploads_path) + if Discourse.store.external? + 0 + else + free(uploads_path) + end end def self.free(path)