mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 05:21:50 +08:00
PERF: Faster disk space calculation on upload heavy instances (#28307)
This commit is contained in:
parent
ab7547eb7a
commit
95d8ed59db
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user