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:
authorAndreas Brandl <abrandl@gitlab.com>2018-10-28 19:50:04 +0300
committerAndreas Brandl <abrandl@gitlab.com>2018-12-03 23:26:49 +0300
commit01c7cb90dabc095ae9d343e7af889c43e895c7c1 (patch)
treeb9f9317e15eed33b30451cd1431167793c82a57a /lib/gitlab/database
parentc5fb4682556d955ecbcbd589ffb18a95c7fbe0a1 (diff)
Refactor specs to separate concerns.
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r--lib/gitlab/database/count.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/gitlab/database/count.rb b/lib/gitlab/database/count.rb
index beb5a8d3556..863a0e95fd4 100644
--- a/lib/gitlab/database/count.rb
+++ b/lib/gitlab/database/count.rb
@@ -25,7 +25,7 @@ module Gitlab
#
# @param [Array]
# @return [Hash] of Model -> count mapping
- def self.approximate_counts(models, strategies = [ReltuplesCountStrategy, ExactCountStrategy])
+ def self.approximate_counts(models, strategies: [ReltuplesCountStrategy, ExactCountStrategy])
strategies.each_with_object({}) do |strategy, counts_by_model|
if strategy.enabled?
models_with_missing_counts = models - counts_by_model.keys
@@ -38,14 +38,6 @@ module Gitlab
end
end
- # Returns a hash of the table names that have recently updated tuples.
- #
- # @param [Array] models to count
- # @returns [Hash] Table name to count mapping (e.g. { 'projects' => 5, 'users' => 100 })
- def self.reltuples_from_recently_updated(models)
- ReltuplesCountStrategy.new(models).count
- end
-
class ExactCountStrategy
attr_reader :models
def initialize(models)