rubocop: fix various style issues.

This commit is contained in:
evazion
2019-12-22 16:21:58 -06:00
parent 09f6a84660
commit 309821bf73
288 changed files with 912 additions and 962 deletions

View File

@@ -7,11 +7,11 @@ Rails.application.configure do
{
url: Danbooru.config.redis_url,
namespace: nil,
connect_timeout: 30, # default: 20 seconds
write_timeout: 0.5, # default: 1 second
read_timeout: 0.5, # default: 1 second
connect_timeout: 30, # default: 20 seconds
write_timeout: 0.5, # default: 1 second
read_timeout: 0.5, # default: 1 second
reconnect_attempts: 0, # default: 0
error_handler: ->(method:, returning:, exception:) {
error_handler: lambda { |method:, returning:, exception:|
DanbooruLogger.log(exception, method: method, returning: returning)
}
}

View File

@@ -31,7 +31,7 @@ if Rails.env.test?
referer = current_page,
redirects = 0
)
action = "#{method.to_s.upcase} #{uri.to_s}"
action = "#{method.to_s.upcase} #{uri}"
retry_count = 0
begin
@@ -43,13 +43,13 @@ if Rails.env.test?
# Pass on the error if we've tried too many times.
if retry_count >= MAX_RESET_RETRIES
print "R"
#puts "**** WARN: Mechanize retried connection reset #{MAX_RESET_RETRIES} times and never succeeded: #{action}"
# puts "**** WARN: Mechanize retried connection reset #{MAX_RESET_RETRIES} times and never succeeded: #{action}"
raise
end
# Otherwise, shutdown the persistent HTTP connection and try again.
print "R"
#puts "**** WARN: Mechanize retrying connection reset error: #{action}"
# puts "**** WARN: Mechanize retrying connection reset error: #{action}"
retry_count += 1
self.http.shutdown
retry
@@ -58,7 +58,7 @@ if Rails.env.test?
# Alias so #fetch actually uses our new #fetch_with_retry to wrap the
# old one aliased as #fetch_without_retry.
alias_method :fetch_without_retry, :fetch
alias_method :fetch, :fetch_with_retry
alias fetch_without_retry fetch
alias fetch fetch_with_retry
end
end
end

View File

@@ -5,8 +5,7 @@ SimpleForm.setup do |config|
# wrapper, change the order or even add your own to the
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
config.wrappers :default, class: :input, hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.

View File

@@ -2,6 +2,6 @@
# This is needed when using Unicorn and preload_app is not set to true.
# See https://newrelic.com/docs/ruby/no-data-with-unicorn
if defined? ::NewRelic
::NewRelic::Agent.manual_start()
::NewRelic::Agent.manual_start
::NewRelic::Agent.after_fork(:force_reconnect => true)
end