From d132f73d42aec530c78680f53bf8a612bac61a3b Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Thu, 4 Jul 2019 15:52:02 +0000 Subject: Implements lease_release on NamespaceAggregation Sets lease_release? to false to prevent the job to be re-executed more often than lease timeout Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64079 --- app/models/namespace/aggregation_schedule.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/models/namespace/aggregation_schedule.rb b/app/models/namespace/aggregation_schedule.rb index 355593597c6..0bef352cf24 100644 --- a/app/models/namespace/aggregation_schedule.rb +++ b/app/models/namespace/aggregation_schedule.rb @@ -44,4 +44,12 @@ class Namespace::AggregationSchedule < ApplicationRecord def lease_key "namespace:namespaces_root_statistics:#{namespace_id}" end + + # Used by ExclusiveLeaseGuard + # Overriding value as we never release the lease + # before the timeout in order to prevent multiple + # RootStatisticsWorker to start in a short span of time + def lease_release? + false + end end -- cgit v1.2.3