Skip to content

Commit

Permalink
Autocorrect lint violations after updating to Rubocop 1.62.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshenny committed Apr 4, 2024
1 parent 1674cf4 commit 3ed8f06
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/net_http/12_bulkhead_quotes_in_forks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SEMIAN_PARAMETERS = {
bulkhead: true,
quota: 1, # Tickets calculated base on number of workers
timeout: 1, # Timeout in seconds (1 sec) to wait to get a free ticket.
timeout: 1, # Timeout in seconds (1 sec) to wait to get a free ticket.
circuit_breaker: false,
}

Expand Down
3 changes: 2 additions & 1 deletion lib/semian/mysql2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def acquire_semian_resource(**)

def raw_semian_options
return query_options[:semian] if query_options.key?(:semian)
return query_options["semian"] if query_options.key?("semian")

query_options["semian"] if query_options.key?("semian")
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/semian/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def resource_exceptions

def raw_semian_options
return options[:semian] if options.key?(:semian)
return options["semian"] if options.key?("semian")

options["semian"] if options.key?("semian")
end

def raise_if_out_of_memory(reply)
Expand Down
2 changes: 1 addition & 1 deletion test/adapters/grpc_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestGRPC < Minitest::Test
}

DEFAULT_SEMIAN_CONFIGURATION = proc do |host|
if host == SemianConfig["toxiproxy_upstream_host"] && \
if host == SemianConfig["toxiproxy_upstream_host"] &&
port == SemianConfig["toxiproxy_upstream_port"] # disable if toxiproxy
next nil
end
Expand Down
4 changes: 2 additions & 2 deletions test/adapters/net_http_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TestNetHTTP < Minitest::Test
error_timeout: 10,
}.freeze
DEFAULT_SEMIAN_CONFIGURATION = proc do |host, port|
if host == SemianConfig["toxiproxy_upstream_host"] && \
if host == SemianConfig["toxiproxy_upstream_host"] &&
port == SemianConfig["toxiproxy_upstream_port"] # disable if toxiproxy
next nil
end
Expand Down Expand Up @@ -311,7 +311,7 @@ def test_use_custom_configuration_to_combine_endpoints_into_one_resource
sample_env = "development"

semian_configuration_proc = proc do |host, port|
if host == SemianConfig["toxiproxy_upstream_host"] && \
if host == SemianConfig["toxiproxy_upstream_host"] &&
port == SemianConfig["toxiproxy_upstream_port"] # disable if toxiproxy
next nil
end
Expand Down
5 changes: 3 additions & 2 deletions test/adapters/redis_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,15 @@ def with_readonly_mode(client)
def new_config(**options)
options[:host] = SemianConfig["toxiproxy_upstream_host"] if options[:host].nil?
semian_options = SEMIAN_OPTIONS.merge(options.delete(:semian) || {})
RedisClient.config(**{
RedisClient.config(
port: SemianConfig["redis_toxiproxy_port"],
reconnect_attempts: 0,
db: 1,
timeout: REDIS_TIMEOUT,
semian: semian_options,
driver: redis_driver,
}.merge(options))
**options,
)
end

def connect_to_redis!(semian_options = {})
Expand Down

0 comments on commit 3ed8f06

Please sign in to comment.