use overwrite semantics for remote file distributor

This commit is contained in:
r888888888
2016-02-02 16:59:14 -08:00
parent 3d9b7f797a
commit 48aa4cc3d6
2 changed files with 4 additions and 3 deletions

View File

@@ -18,8 +18,9 @@ class RemoteFileManager
ftp.rename!(temp_path, path)
rescue Net::SFTP::StatusException
# this typically means the file already exists
# so just clean up
ftp.remove(temp_path)
# so delete and try renaming again
ftp.remove!(path)
ftp.rename!(temp_path, path)
end
end
end