summaryrefslogtreecommitdiff
path: root/lib/gitlab/hashed_storage
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2019-06-24 20:31:38 +0200
committerGabriel Mazetto <brodock@gmail.com>2019-07-10 22:14:50 +0100
commitd8cad8837cae22130f2e0975155a3b27a66d878c (patch)
tree99568d2fea74b637d0c882e7090584a35b1fdeab /lib/gitlab/hashed_storage
parentc1fe76f15ba8d2418c428d2c9e88c133bfc69a6f (diff)
downloadgitlab-ce-d8cad8837cae22130f2e0975155a3b27a66d878c.tar.gz
Display the amount for Hashed Storage migration/rollback correctly63667-hashed-storage-migration-count-correctly
Rake script considers the specified range, if present, to calculate the affected amount of projects correctly.
Diffstat (limited to 'lib/gitlab/hashed_storage')
-rw-r--r--lib/gitlab/hashed_storage/rake_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/hashed_storage/rake_helper.rb b/lib/gitlab/hashed_storage/rake_helper.rb
index 87a31a37e3f..14727b03ce9 100644
--- a/lib/gitlab/hashed_storage/rake_helper.rb
+++ b/lib/gitlab/hashed_storage/rake_helper.rb
@@ -19,8 +19,12 @@ module Gitlab
ENV['ID_TO']
end
+ def self.using_ranges?
+ !range_from.nil? && !range_to.nil?
+ end
+
def self.range_single_item?
- !range_from.nil? && range_from == range_to
+ using_ranges? && range_from == range_to
end
# rubocop: disable CodeReuse/ActiveRecord