mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
move notification about low disk space into its own method
This commit is contained in:
parent
23a5c6444a
commit
7581a7d869
1 changed files with 6 additions and 1 deletions
|
@ -274,12 +274,17 @@ class CookedPostProcessor
|
|||
reason = I18n.t("disable_remote_images_download_reason")
|
||||
staff_action_logger = StaffActionLogger.new(Discourse.system_user)
|
||||
staff_action_logger.log_site_setting_change("download_remote_images_to_local", true, false, { details: reason })
|
||||
|
||||
# also send a private message to the site contact user
|
||||
SystemMessage.create_from_system_user(Discourse.site_contact_user, :download_remote_images_disabled)
|
||||
notify_about_low_disk_space
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def notify_about_low_disk_space
|
||||
SystemMessage.create_from_system_user(Discourse.site_contact_user, :download_remote_images_disabled)
|
||||
end
|
||||
|
||||
def available_disk_space
|
||||
100 - `df -P #{Rails.root}/public/uploads | tail -1 | tr -s ' ' | cut -d ' ' -f 5`.to_i
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue