mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:21:25 +08:00
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:
@ -642,9 +642,9 @@ class CookedPostProcessor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def disable_if_low_on_disk_space
|
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 !SiteSetting.download_remote_images_to_local
|
||||||
return false if available_disk_space >= SiteSetting.download_remote_images_threshold
|
return false if available_disk_space >= SiteSetting.download_remote_images_threshold
|
||||||
return false if Discourse.store.external?
|
|
||||||
|
|
||||||
SiteSetting.download_remote_images_to_local = false
|
SiteSetting.download_remote_images_to_local = false
|
||||||
# log the site setting change
|
# log the site setting change
|
||||||
|
Reference in New Issue
Block a user