diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-09 10:31:31 -0500 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-09 10:31:31 -0500 |
commit | f7b8ae3fe2adc95f18f779d737e60eac45a14223 (patch) | |
tree | e4a69fe0ea45085e2161729111f99ff94f5a3a03 /lib | |
parent | 6466739e2e61f790a9e1f09020dba710c4078a0f (diff) | |
download | gitlab-ce-f7b8ae3fe2adc95f18f779d737e60eac45a14223.tar.gz |
apply feedback
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/uploads/helpers.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/tasks/gitlab/uploads/helpers.rb b/lib/tasks/gitlab/uploads/helpers.rb deleted file mode 100644 index 239cba57297..00000000000 --- a/lib/tasks/gitlab/uploads/helpers.rb +++ /dev/null @@ -1,23 +0,0 @@ -module UploadTaskHelpers - def batch_size - ENV.fetch('BATCH', 200).to_i - end - - def calculate_checksum(absolute_path) - Digest::SHA256.file(absolute_path).hexdigest - end - - def check_checksum(upload) - checksum = calculate_checksum(upload.absolute_path) - - if checksum != upload.checksum - puts " * File checksum (#{checksum}) does not match the one in the database (#{upload.checksum})".color(:red) - end - end - - def uploads_batches(&block) - Upload.all.in_batches(of: batch_size, start: ENV['ID_FROM'], finish: ENV['ID_TO']) do |relation| # rubocop: disable Cop/InBatches - yield relation - end - end -end |