mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: use DiskSpace module for all disk space calculations
This normalizes it so we only carry one place for grabbing disk space size It also normalizes the command made so it uses Discourse.execute_command which splits off params in a far cleaner way.
This commit is contained in:
@ -215,7 +215,7 @@ class Admin::BackupsController < Admin::AdminController
|
||||
private
|
||||
|
||||
def has_enough_space_on_disk?(size)
|
||||
`df -Pk #{Rails.root}/public/backups | awk 'NR==2 {printf "%.0f", $4 * 1024;}'`.to_i > size
|
||||
DiskSpace.free("#{Rails.root}/public/backups") > size
|
||||
end
|
||||
|
||||
def ensure_backups_enabled
|
||||
|
Reference in New Issue
Block a user