DEV: See if the store is external before checking disk space (#8480)

`available_disk_space` calls `df` which exits with an error if the `uploads` path doesn't exist. That's often the case when the `Discourse.store.external?` is true.

By doing the `external?` check first the `disable_if_low_on_disk_space` does less work and doesn't output any errors to the console.
This commit is contained in:
Jarek Radosz 2019-12-09 02:48:45 +01:00 committed by Sam
parent e7bd288d7b
commit 02ca6fa6c8

View File

@ -642,9 +642,9 @@ class CookedPostProcessor
end
def disable_if_low_on_disk_space
return false if Discourse.store.external?
return false if !SiteSetting.download_remote_images_to_local
return false if available_disk_space >= SiteSetting.download_remote_images_threshold
return false if Discourse.store.external?
SiteSetting.download_remote_images_to_local = false
# log the site setting change