FIX: Account for empty uploads directory upon backup restore (#8262)
This commit fixes a case where backup restores would fail if the uploads/default directory is empty.
This commit is contained in:
parent
cacf99e144
commit
c3f06943c7
|
@ -436,6 +436,7 @@ module BackupRestore
|
|||
FileUtils.mkdir_p("uploads")
|
||||
|
||||
tmp_uploads_path = Dir.glob(File.join(@tmp_directory, "uploads", "*")).first
|
||||
return if tmp_uploads_path.blank?
|
||||
previous_db_name = BackupMetadata.value_for("db_name") || File.basename(tmp_uploads_path)
|
||||
current_db_name = RailsMultisite::ConnectionManagement.current_db
|
||||
optimized_images_exist = File.exist?(File.join(tmp_uploads_path, 'optimized'))
|
||||
|
|
Loading…
Reference in New Issue