Commit b2c36f31 authored by Andreas Brandl's avatar Andreas Brandl

Fix Ruby 2.7 deprecation warning

In Ruby 3.0, positional arguments and keyword arguments will be
separated. Ruby 2.7 will warn for behaviors that will change in Ruby
3.0.

This is a follow-up to 911fcbc3, and
just uses keyword arguments where possible. In cases where it's not
possible, we use the splat ** operator instead.
parent 911fcbc3
......@@ -336,7 +336,7 @@ module Gitlab
logger: Gitlab::BackgroundMigration::Logger
}.merge(args)
Gitlab::Database::WithLockRetries.new(merged_args).run(&block)
Gitlab::Database::WithLockRetries.new(**merged_args).run(&block)
end
def true_value
......
......@@ -72,10 +72,10 @@ module Gitlab
end
def with_lock_retries(&block)
Gitlab::Database::WithLockRetries.new(**{
Gitlab::Database::WithLockRetries.new(
klass: self.class,
logger: Gitlab::AppLogger
}).run(&block)
).run(&block)
end
def connection
......
......@@ -99,7 +99,7 @@ module Gitlab
def with_lock_retries(&block)
arguments = { klass: self.class, logger: logger }
Gitlab::Database::WithLockRetries.new(arguments).run(raise_on_exhaustion: true, &block)
Gitlab::Database::WithLockRetries.new(**arguments).run(raise_on_exhaustion: true, &block)
end
delegate :execute, to: :connection
......
......@@ -68,10 +68,10 @@ module Gitlab
end
def with_lock_retries(&block)
Gitlab::Database::WithLockRetries.new({
Gitlab::Database::WithLockRetries.new(
klass: self.class,
logger: Gitlab::BackgroundMigration::Logger
}).run(&block)
).run(&block)
end
def assert_not_in_transaction_block(scope:)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment