Fix Rubocop offenses

This commit is contained in:
Sebastian Serth
2023-07-27 09:32:45 +02:00
parent 66c3cb2635
commit 5faf5be033
3 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ class LiveStreamsController < ApplicationController
def send_runner_file(runner, desired_file, redirect_fallback = root_path, privileged: false) def send_runner_file(runner, desired_file, redirect_fallback = root_path, privileged: false)
filename = File.basename(desired_file) filename = File.basename(desired_file)
send_stream(filename:, type: 'application/octet-stream', disposition: 'attachment') do |stream| send_stream(filename:, type: 'application/octet-stream', disposition: 'attachment') do |stream|
runner.download_file desired_file, privileged_execution: privileged do |chunk, overall_size, _content_type| runner.download_file(desired_file, privileged_execution: privileged) do |chunk, overall_size, _content_type|
unless response.committed? unless response.committed?
# Disable Rack::ETag, which would otherwise cause the response to be cached # Disable Rack::ETag, which would otherwise cause the response to be cached
# See https://github.com/rack/rack/issues/1619#issuecomment-848460528 # See https://github.com/rack/rack/issues/1619#issuecomment-848460528

View File

@ -52,18 +52,18 @@ class Runner < ApplicationRecord
@strategy.copy_files(files) @strategy.copy_files(files)
end end
def download_file(path, **options, &) def download_file(...)
@strategy.download_file(path, **options, &) @strategy.download_file(...)
end end
def retrieve_files(raise_exception: true, **options) def retrieve_files(raise_exception: true, **)
try = 0 try = 0
begin begin
if try.nonzero? if try.nonzero?
request_new_id request_new_id
save save
end end
@strategy.retrieve_files(**options) @strategy.retrieve_files(**)
rescue Runner::Error::RunnerNotFound => e rescue Runner::Error::RunnerNotFound => e
Rails.logger.debug { "Retrieving files failed for the first time: #{e.message}" } Rails.logger.debug { "Retrieving files failed for the first time: #{e.message}" }
try += 1 try += 1

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class ServiceBase class ServiceBase
def self.call(**args) def self.call(**)
new(**args).execute new(**).execute
end end
end end