diff options
Diffstat (limited to 'lib/tasks/gitlab/uploads/helpers.rb')
-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 |