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 ...@@ -336,7 +336,7 @@ module Gitlab
logger: Gitlab::BackgroundMigration::Logger logger: Gitlab::BackgroundMigration::Logger
}.merge(args) }.merge(args)
Gitlab::Database::WithLockRetries.new(merged_args).run(&block) Gitlab::Database::WithLockRetries.new(**merged_args).run(&block)
end end
def true_value def true_value
......
...@@ -72,10 +72,10 @@ module Gitlab ...@@ -72,10 +72,10 @@ module Gitlab
end end
def with_lock_retries(&block) def with_lock_retries(&block)
Gitlab::Database::WithLockRetries.new(**{ Gitlab::Database::WithLockRetries.new(
klass: self.class, klass: self.class,
logger: Gitlab::AppLogger logger: Gitlab::AppLogger
}).run(&block) ).run(&block)
end end
def connection def connection
......
...@@ -99,7 +99,7 @@ module Gitlab ...@@ -99,7 +99,7 @@ module Gitlab
def with_lock_retries(&block) def with_lock_retries(&block)
arguments = { klass: self.class, logger: logger } 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 end
delegate :execute, to: :connection delegate :execute, to: :connection
......
...@@ -68,10 +68,10 @@ module Gitlab ...@@ -68,10 +68,10 @@ module Gitlab
end end
def with_lock_retries(&block) def with_lock_retries(&block)
Gitlab::Database::WithLockRetries.new({ Gitlab::Database::WithLockRetries.new(
klass: self.class, klass: self.class,
logger: Gitlab::BackgroundMigration::Logger logger: Gitlab::BackgroundMigration::Logger
}).run(&block) ).run(&block)
end end
def assert_not_in_transaction_block(scope:) 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