From 95d8ed59db5531414ed7976691d6c9a25027b366 Mon Sep 17 00:00:00 2001 From: overgrow Date: Thu, 24 Oct 2024 12:11:40 +0200 Subject: [PATCH] PERF: Faster disk space calculation on upload heavy instances (#28307) --- lib/disk_space.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/disk_space.rb b/lib/disk_space.rb index c7ee672cc0b..6ddb9365fc1 100644 --- a/lib/disk_space.rb +++ b/lib/disk_space.rb @@ -2,11 +2,7 @@ class DiskSpace def self.uploads_used_bytes - if Discourse.store.external? - Upload.sum(:filesize).to_i + OptimizedImage.sum(:filesize).to_i - else - used(uploads_path) - end + Upload.sum(:filesize).to_i + OptimizedImage.sum(:filesize).to_i end def self.uploads_free_bytes