From f7b8ae3fe2adc95f18f779d737e60eac45a14223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mica=C3=ABl=20Bergeron?= Date: Fri, 9 Mar 2018 10:31:31 -0500 Subject: apply feedback --- lib/tasks/gitlab/uploads/helpers.rb | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 lib/tasks/gitlab/uploads/helpers.rb (limited to 'lib/tasks/gitlab/uploads') 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 -- cgit v1.2.1