We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f9ea39 commit 0b6f4b3Copy full SHA for 0b6f4b3
lib/informers/utils/hub.rb
@@ -85,12 +85,14 @@ def put(request, response)
85
output_path = resolve_path(request)
86
87
begin
88
+ tmp_path = "#{output_path}.incomplete"
89
FileUtils.mkdir_p(File.dirname(output_path))
- File.open(output_path, "wb") do |f|
90
+ File.open(tmp_path, "wb") do |f|
91
while !response.eof?
92
f.write(response.read(1024 * 1024))
93
end
94
95
+ FileUtils.move(tmp_path, output_path)
96
rescue => e
97
warn "An error occurred while writing the file to cache: #{e}"
98
0 commit comments