Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/database/batched_background_migration_worker.rb')
-rw-r--r--app/workers/database/batched_background_migration_worker.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/workers/database/batched_background_migration_worker.rb b/app/workers/database/batched_background_migration_worker.rb
index de274d58ad7..039b45a497f 100644
--- a/app/workers/database/batched_background_migration_worker.rb
+++ b/app/workers/database/batched_background_migration_worker.rb
@@ -38,7 +38,7 @@ module Database
end
def with_exclusive_lease(interval)
- timeout = max(interval * LEASE_TIMEOUT_MULTIPLIER, MINIMUM_LEASE_TIMEOUT)
+ timeout = [interval * LEASE_TIMEOUT_MULTIPLIER, MINIMUM_LEASE_TIMEOUT].max
lease = Gitlab::ExclusiveLease.new(lease_key, timeout: timeout)
yield if lease.try_obtain
@@ -46,10 +46,6 @@ module Database
lease&.cancel
end
- def max(left, right)
- left >= right ? left : right
- end
-
def lease_key
self.class.name.demodulize.underscore
end