mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-15 18:08:29 +00:00
Fix Ameba Lint/UselessAssign
This commit is contained in:
parent
7226a72824
commit
dc198546a0
@ -106,8 +106,7 @@ Spectator.describe StaticAssetsHandler do
|
|||||||
file_link = "/#{File.basename(temporary_file.path)}"
|
file_link = "/#{File.basename(temporary_file.path)}"
|
||||||
|
|
||||||
# Make request
|
# Make request
|
||||||
headers = HTTP::Headers{"Range" => "bytes=0-2"}
|
handle HTTP::Request.new("GET", file_link, HTTP::Headers{"Range" => "bytes=0-2"})
|
||||||
response = handle HTTP::Request.new("GET", file_link, headers)
|
|
||||||
|
|
||||||
# Mutate file on disk
|
# Mutate file on disk
|
||||||
temporary_file << "Something else"
|
temporary_file << "Something else"
|
||||||
|
@ -71,7 +71,7 @@ module Invidious::HttpServer
|
|||||||
|
|
||||||
# Writes file data to the cache
|
# Writes file data to the cache
|
||||||
private def flush_io_to_cache(io, file_path, file_info)
|
private def flush_io_to_cache(io, file_path, file_info)
|
||||||
if @@cached_files.sum(&.[1].size) + (size = file_info.size) < CACHE_LIMIT
|
if @@cached_files.sum(&.[1].size) + file_info.size < CACHE_LIMIT
|
||||||
data_slice = io.to_slice
|
data_slice = io.to_slice
|
||||||
@@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time)
|
@@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user