Giter Club home page Giter Club logo

Comments (3)

jterapin avatar jterapin commented on July 22, 2024 1

Resolved in #2902.

from aws-sdk-ruby.

foxtrod avatar foxtrod commented on July 22, 2024

Would be glad if i missed existing functionality that covers download progress, but if someone wonders I'm using next workaround:

download_thread = Thread.new do
  s3_object.download_file(destination, { thread_count: threads_count, mode: "get_range", chunk_size: chunk_size })
end

progress_thread = Thread.new do
  begin
    while download_thread.alive? # ping file size until download processing
      current_size = File.exist?(destination) ? File.size(destination) : 0
      progress_percentage = (current_size.to_f / expected_size) * 100

      puts "Downloaded: #{current_size} / #{expected_size} (#{progress_percentage.round(2)}%)"

      break if current_size >= expected_size

      sleep 1 # wait for a second before checking again
    end
  rescue => e
    logger.error(event: :progress_thread, error: e)
  end
end

download_thread.join 
progress_thread.join

from aws-sdk-ruby.

github-actions avatar github-actions commented on July 22, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

from aws-sdk-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.