Skip to content

Commit

Permalink
Merge branch 'dev' into fix/AACT-717-fix-dbquery-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micronix authored Jun 14, 2024
2 parents 303ad1f + 3899af1 commit 46d4c71
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/models/study_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ def self.find_studies_to_remove
end


private

def self.print_progress(current, total, message_prefix="downloading")
progress = (current.to_f / total * 100).round(2)
formatted_progress = '%.2f' % progress # Ensures two decimal places
# extra spaces to ensure that the previous print is overwritten
if current == total
puts "\r#{message_prefix} #{total} studies: 100% "
else
print "\r#{message_prefix} #{total} studies: #{formatted_progress}% "
end
end


private

def self.print_progress(current, total, message_prefix="downloading")
Expand Down

0 comments on commit 46d4c71

Please sign in to comment.