mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 05:47:45 +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
|
class DiskSpace
|
||||||
def self.uploads_used_bytes
|
def self.uploads_used_bytes
|
||||||
if Discourse.store.external?
|
Upload.sum(:filesize).to_i + OptimizedImage.sum(:filesize).to_i
|
||||||
Upload.sum(:filesize).to_i + OptimizedImage.sum(:filesize).to_i
|
|
||||||
else
|
|
||||||
used(uploads_path)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.uploads_free_bytes
|
def self.uploads_free_bytes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user