mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Put temp.delete inside ensure block
This commit is contained in:
parent
67f98cb60d
commit
2139308a0e
@ -298,6 +298,7 @@ struct Invidious::User
|
|||||||
# Ensure max size of 4MB
|
# Ensure max size of 4MB
|
||||||
io_sized = IO::Sized.new(file_io, 0x400000)
|
io_sized = IO::Sized.new(file_io, 0x400000)
|
||||||
|
|
||||||
|
begin
|
||||||
temp = File.tempfile(".db") do |tempfile|
|
temp = File.tempfile(".db") do |tempfile|
|
||||||
begin
|
begin
|
||||||
File.write(tempfile.path, io_sized.gets_to_end)
|
File.write(tempfile.path, io_sized.gets_to_end)
|
||||||
@ -321,7 +322,9 @@ struct Invidious::User
|
|||||||
Invidious::Database::Users.update_subscriptions(user)
|
Invidious::Database::Users.update_subscriptions(user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
temp.delete
|
ensure
|
||||||
|
temp.delete if !temp.nil?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user