mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
FIX: Errno::EXDEV when across filesystem boundaries (#13976)
ref https://bugs.ruby-lang.org/issues/12615 ``` W: rake aborted! W: Errno::EXDEV: Invalid cross-device link @ rb_file_s_rename - (/app/tmp/adeeee62504de67238341871bda1aaf0, /app/app/assets/javascripts/plugins/discourse-cakeday.js.e rb) W: lib/discourse.rb:65:in `rename' W: lib/discourse.rb:65:in `atomic_write_file' W: /app/lib/plugin/instance.rb:683:in `activate!' W: lib/discourse.rb:246:in `block in activate_plugins!' W: lib/discourse.rb:243:in `each' W: lib/discourse.rb:243:in `activate_plugins!' ```
This commit is contained in:
parent
e68c1d5ba5
commit
03896a9c43
|
@ -99,7 +99,7 @@ module Discourse
|
||||||
fd.fsync()
|
fd.fsync()
|
||||||
end
|
end
|
||||||
|
|
||||||
File.rename(temp_destination, destination)
|
FileUtils.mv(temp_destination, destination)
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
@ -113,7 +113,7 @@ module Discourse
|
||||||
FileUtils.mkdir_p(File.join(Rails.root, 'tmp'))
|
FileUtils.mkdir_p(File.join(Rails.root, 'tmp'))
|
||||||
temp_destination = File.join(Rails.root, 'tmp', SecureRandom.hex)
|
temp_destination = File.join(Rails.root, 'tmp', SecureRandom.hex)
|
||||||
execute_command('ln', '-s', source, temp_destination)
|
execute_command('ln', '-s', source, temp_destination)
|
||||||
File.rename(temp_destination, destination)
|
FileUtils.mv(temp_destination, destination)
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user