diff --git a/examples/net_http/12_bulkhead_quotes_in_forks.rb b/examples/net_http/12_bulkhead_quotes_in_forks.rb index 72ea080e..f7699cbe 100644 --- a/examples/net_http/12_bulkhead_quotes_in_forks.rb +++ b/examples/net_http/12_bulkhead_quotes_in_forks.rb @@ -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, } diff --git a/lib/semian/mysql2.rb b/lib/semian/mysql2.rb index e26ebd85..bfea2758 100644 --- a/lib/semian/mysql2.rb +++ b/lib/semian/mysql2.rb @@ -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 diff --git a/lib/semian/redis.rb b/lib/semian/redis.rb index 929d5d3e..c7d48de0 100644 --- a/lib/semian/redis.rb +++ b/lib/semian/redis.rb @@ -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) diff --git a/test/adapters/grpc_test.rb b/test/adapters/grpc_test.rb index 253cb1b9..e1974ec6 100644 --- a/test/adapters/grpc_test.rb +++ b/test/adapters/grpc_test.rb @@ -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 diff --git a/test/adapters/net_http_test.rb b/test/adapters/net_http_test.rb index cc29ae9e..9e87826c 100644 --- a/test/adapters/net_http_test.rb +++ b/test/adapters/net_http_test.rb @@ -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 @@ -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 diff --git a/test/adapters/redis_client_test.rb b/test/adapters/redis_client_test.rb index f0ebf941..27b03758 100644 --- a/test/adapters/redis_client_test.rb +++ b/test/adapters/redis_client_test.rb @@ -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 = {})