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
path: root/app
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-07-04 18:52:02 +0300
committerRémy Coutable <remy@rymai.me>2019-07-04 18:52:02 +0300
commitd132f73d42aec530c78680f53bf8a612bac61a3b (patch)
tree6a00ae449c40dcdf3c2d9b50c0e9559340b4ff84 /app
parentf62aa64b74b988c5539496147674996f44aafdbf (diff)
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
Diffstat (limited to 'app')
-rw-r--r--app/models/namespace/aggregation_schedule.rb8
1 files changed, 8 insertions, 0 deletions
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